I know what you mean. I think the key is to try to learn to think--pause--before responding instead of a knee-jerk reaction.
I'm thinking of the "counting to ten" idea, for example. Count to ten before responding to something. Or take a break, such as saying something such as "I need to go to the restroom" and walk out of the room. Go "get some air."