I used to tilt a lot when I was playing cardgames in college. What changed was my approach:
Don't play to win. Play to improve.
After each game ask yourself what, knowing what you know now about how the game went, you could have done differently to improve your chances of winning. There's almost always something you could have done in hindsight, even if it isn't obvious at the time.
Focus on making the best move each turn, whether it's a win or a loss. Did you get a bad opening hand? Okay, how can you maximize your chances of winning anyway? This is a great chance to improve. Did you get paired against a bad matchup? Excellent, see what you can do to improve your odds, maybe by playing very differently than normal.
This is also why I say, "If you can't beat a deck, try it yourself. Your opponents will teach you how to beat it."