Memory game

I'm creating a memory game but I don't know how to ensure that when two cards match, they disappear, and if not, they flip back over. Additionally, I need to ensure that this interaction is limited to two cards at a time.

Any idea how I can do it?

memory game.mov