It has been personally helpful to think of myself as ultimately responsible to God rather than to humans. This can be a cop-out or an excuse, but I mean God as the ultimate knower of truth. I submit to what I can best ascertain is what God thinks, as opposed to what those around me think. And if you need a proof text, how about Romans 8:33?
So when others are angry at you or are accusing you of wrong or berating you:
1. What if any truth is there in what they are saying?
Some are prone to dismiss the criticism of others out of hand, those who cannot take any criticism even when it is constructive. We must always consider that there may some truth to what they are saying, often is. By the same token, some are too quick to accept the criticism of others when it is in reality the others who have the problem.
2. If there is nothing valid in their criticism...
Smile and wave, boys, smile and wave. Why get upset when they're the one who's an idiot? If I'm confident there's no truth to what they're saying, why should I be bothered? For some, being angry in response can indicate there's actually some truth to what they're saying. Of course there's a point where you say enough is enough and let a person know you're not going to have any more interaction with them if they're going to continue berating you inappropriately.
3. If there is something valid and you can change...
Then resolve to change and forget about it. You can't change the past and if you've done all you can do, it's over. Don't accept continued blame if you've truly changed. There can be consequences in some circumstances, but at some point the accuser can actually become the wrongdoer after your "sins" are atoned for.
4. If there is something valid and you can't change...
Then you need to remove yourself from being in a position to wrong another or fail again.
We as humans are prone to self-deception. Seek the counsel of others, often more than one.