You can't really teach mindgames. Its just something you get from experience, especially with upper level players.
Mindgames is thinking about what your opponent is going to do before he does it, essentially. So if you notice your opponent usually rolls behind you, you punish by knowing where he is going and counterattacking.
Mindgames is making sure your game is varied so that your opponent cannot foresee your next move. You may even have good enough mindgames to make him think you will do one thing, he will react, but than you do what he didn't expect and than exploit his wrong anticipation.
For example- You are Marth and you grab Fox, and start CG'ing. He likes to stop DI'ing at 23-29% to try and interrupt your chaingrab with a shine. So you are kneeing him, giving him time to realize he is about to get up thrown. He lets go of the direction and gets ready to mash the down and A asap. Rather than throw and hope he simply misses the shine, you throw in a curve ball. You Fthrow rather than u-throw, he misses the tech because he is not expecting the fthrow, and you get a free smash, or you can simply DD and grab him when he tries to get up.
This is a mindgame. You are constantly watching your opponent to try to pick up habits, and than thinking ahead and see his habit coming, and than counterattacking. This sort of mindgame is more of a mindgame trick, something that works on a bunch of people. Other mindgames can just be something you do on the spot after picking up on someones game.
If you have no mindgames, you usually play like you are on cruise control. You just let your fingers play, but you don't do much thinking. These are the sorts of players than don't do so well against smart players. They are too easy to punish for bad habits. Try to vary your game more, don't be repetitive.
I hope this helped.