It's just like a card memory game: In each move, you click on 2 hats and get to see what's inside. If both contain the same animal, they are removed from the board. Try to clear the board in as little moves as possible.