I think it's mostly knowing your group and finding like minded people.

To generalize the people who tend to rage, they usually don't like losing, and when they do lose they are quick to blame others.

You can mitigate some foreseen rage, such as if you are planning to play a new role, or new to the fight, it'll be considerate to announce to the group before hand.
However, it's not possible to avoid it all together, unless if you're playing with people you know well.