The gems on the gameboard represent the different elements of Magic.
Match 3 or more of the same color to remove them from the gameboard. As you make matches, you fill up your card's mana costs. When full, your character will cast that Creature, Spell, or Support.
Keep in mind that mana color does not matter in regards to your cards, but it makes a difference regarding how much mana you generate depending on your current Planeswalker and their associated color bonuses.