Boy... I wish I knew the answer to this!
I have a propensity to pop off at the slightest provocation!
About all I have been able to come up with is to try to maintain an awareness of the fact that I have this predilection. And then, when a "situation" arises, I try to take a breath & breathe into that urge to attack with the hope that it will pass & I will be able to respond more maturely. (I guess it's sort-of a variation on the practice of compassionate abiding.)* Sometimes it works... other times it doesn't.
To be honest, I don't really believe I'll ever get it right 100% of the time.
But, each time I catch myself & step back, I hopefully get just a little bit better at doing it. And I increase the likelihood that I'll be able to do it again the next go-around.
* Just in case you're not familiar with it, here's a link to a description of the practice:
https://mindsetdoc.wordpress.com/201...e-abiding-101/