Personally what has helped me in the past was to get the "satellite" view of things. You have to view just about everything you do in life in this manner. I also always try to smile and think positive thoughts. When confronted with a situation that may piss me off, I just have to think... Does it really matter? Will I remember this in a year and will it matter then as well.
I have also used this strategy to get even (yes I am a cold calculating bastard behind my nice guy attitude). I have thrown out the devil's advocate question to get someone to think about what they are saying, even when I agree with them. Staying calm in any sort of discussion (heated or not), gives you one step up.
You really have to look at the consequences of your actions (or reactions) and act accordingly. What will it really gain you if you yell at someone or let them get to you? This may mean that you have to control your emotions and take that second or 2 before responding.