All the advice in this thread is really good.
One thing I've identified recently which has really helped me is "externalising" rather than "internalising" i.e. focus on what other people are doing not what you're doing.
An example, you lose a big pot when villain calls your two pot sized bets on the flop and turn and hits his gutshot on the river. Instead of thinking "that f*****g sucks, I just lost a buy in". Think "ok, he's going to draw without proper odds. He's limp calling 89o." Make a note and move on.
You will only tilt if you internalise something bad.
Hopefully that helps prevent tilt a bit. If the red eyed monster hits in a big way, quitting is still by far the best thing to do.