Yeah I can relate. Learning to stop and breathe deeply while counting to 10 can help. So u can compose ur thoughts in a calm manner b4 responding, also depending on the type of relationship...it can be helpful to sit down and talk to the person about how their behaviours make you feel...using non accusatory language, calm manner, and validating their thoughts and feelings while asking for some kind of compromise or agreed upon boundaries...basically defuse the situation before it builds...obviously some ppl and situations that is not for..like confronting your boss unless they are open to constructive criticism or ....a situation like some jack off at the bar/ other stranger.obviously not gonna talk about anything productively. And sometimes the best thing to do is simply turnaround and walk away. If the person try to follow you, firmly bit calmly inform them you need sometime alone, and will speak with them at a later time or date...or if they are a stranger just breathe n kero walking..they are unlikely to follow u far. Hope that's a helpful start.
__________________
"The woods are lovely, dark, and deep
But I have promises to keep
And miles to go before I sleep
And miles to go before I sleep"