This is actually the main focus of my game ATM. And not just the tilt you are speaking about, but all forms of tilt, and there are soooo many.
I find that if a loose/bad player sucks out on me, I have to concentrate hard to not play any different that I was vs him b4 the suck out. I knew he was bad already, so he is stil the same player, BUT I am now seeing him as having "my" money in his stack. So, I target him differently that I had been doing, and this is not good. If you find yourself opening/calling wider vs this playerto get "your" money back, your best bet is to leave the table cause you are playing a lesser game, and that is bad. If you are getting in more pots vs this player, BUT are playing controlled and folding/calling/raising/3-4 betting/ shoving where you should, then stay and reap the reward. As long as you can differentiate.
If you find you are playing with ANY emotion whatsoever, quit. Easy. Go for a walk, have a cup of tee, kiss your GF, whatever. If you find you are tired and not paying attention, quit. If you are nodding off, quit. If you are thinking about a work problem and the timer calls you back to the action, quit.
I struggle to keep my cool when things are going bad, but I am developing a new poker skill. I am learning to quit good. I lose, and have lost, a lot due to tilt. If you know that you are tilting, try to recognize when you are playing with emotion and QUIT. Then review, and learn to recognize, and see the signs before they arrive.
Its a long road, keep trying to get there.