Tilt is easier to prevent it than to fight it when it happens.
To prevent it, you have to keep in mind that only bad players tilt cause they dont think poker in long terms. Why is that? Cause when you shove aces on 29K flop and your opponent calls with a 9 to give you a bad beat with 2 pair on the river most newbies players will tilt. Cause they see the tree and not the forest. When you start seeing the long picture, you should be happy instead of tilted. Cause if you played it right, donks shouldnt matter you at all, cause in the end you will be in profit. Thats the mindset to prevent it.
If you dont prevent it, just quit for a day and clear your head. Ask yourself. Did I play it right? If you did, get back in and never play with a mindset to chase losses or played scared of getting coolered.