Pay attention.
When I get frustrated with the behavior of some individuals, a friend of mine says "you've got to start paying attention when people tell you who they are."
In general I am not usually suprised by what people do. When they behave badly, I am mostly annoyed that I created the platform that allowed it to impact me.
Sometimes when trying to make sure I'm being objective and fair, I can grant the benefit of the doubt way too often. Rationalizing one person's bad behavior for too long can decay a group's morale by sending a mixed message around expectations.
We all behave poorly from time to time, and are entitled to our mistakes. The key is to admit to the mistake, apologize to those impacted, and adapt your behavior to avoid the same type incident in the future.
I don't know anyone who won't accept an apology, but I know a lot who won't offer one.
Sometimes questionable behavior is not a mistake, it's a signal. So, pay attention early and often to what people tell you about themselves through their actions. By doing so, you'll have much more time and energy to invest in those with the most to give back.