Your anger should always be for "the sake of heaven."
Direct your anger toward the kelipot [forces of evil]
in the person who upsets you,
and not at the person himself.
Understand that the kelipot scare him into doing evil things.
Then you can use your anger
to bring the kelipot under the sway of holiness.
That's from God in All Moments: Mystical & Practical Spiritual Wisdom from Hasidic Masters, edited and translated by Or Rose and Ebn Leader. It's a quote from R. Dov Baer of Mezritch, from his text Hayim v'Hesed, #12.
What are the kelipot? This concept (early medieval in origin) was re-imagined and popularized by mystic Isaac Luria (d. 1572.) Luria taught that God withdrew to make a space in which to place creation, and sent divine energy, in the form of light, into the newly-emanated world. But the vessels which had been created to hold that light were too fragile, and they shattered. The broken shards of those vessels are the kelipot -- shells or husks or shards -- and they keep divine light hidden. Our task, say the Hasidim, is to peel away the kelipot and lift up the sparks of holiness which they conceal.
What I love about this short passage from Dov Baer of Mezritch is this: he reminds me that anger should be for the sake of heaven, not for the sake of ego or vindication. I like his teaching that if someone makes me angry, I should direct my anger toward the broken shards embedded in that person's heart, toward the thick callus preventing compassion from coming through, and not toward the person themselves. If anger is necessary -- and it sometimes is! -- try to point it at whatever is preventing the other person from being compassionate and kind, not at the person themselves.
Happy election season, my fellow Americans. :-)