From Bulbapedia, the community-driven Pokémon encyclopedia.
After doing a couple of missions, you fill in for Diglett on Sentry Duty because he is doing his father's duties today.
Loudred explains that the grate you stepped on top of on the day you joined the Guild, is the grate you look through from below to guess the Pokémon that passes. In the mini-game, there is a foot print on the top screen and there are 4 Pokémon on the bottom screen. You have to guess which Pokémon the foot print belongs to. You get 2 tries total for the minigame and there are 6 footprints to assign. The mini-game takes the whole day. If you're having trouble with the game, use logic. For example, if the footprint look's like a bird's foot, you can infer that it belongs to a bird-like Pokémon.
At the end of the day, Chatot gives you rewards based on how many you guess correctly, how fast and how accurate. If you get a perfect score, you will get 500 Poké, a Max Elixir, and many stat-boosting items.