Assume the other person had a reason
You explain your own behaviour by circumstance and theirs by character. So do they.
Do this
Before reacting to someone's behaviour, generate one situational explanation that would fully account for it. Then act on the assumption it might be true. You are not required to believe it - only to check.
Why it works
The tendency to over-attribute others' behaviour to disposition and our own to situation is one of the more robust findings in social psychology, though it varies across cultures more than early work assumed. The asymmetry is largely explained by having far more information about our own circumstances.
Where it fails
Applied indiscriminately this becomes a way of excusing repeated harm. Patterns are dispositional information - the correction is for single instances, not for someone's third time.
How you’ll know
Notice how often the situational explanation turns out to be right when you eventually find out. Most people are startled by the rate.