Shaar Ruach HaKodesh in the writings of the Ari, which contains (amongst other things) numerous remedies (tikunim) for various sins, includes Remedy #13 (p. 18a in the standard editions, p. 50 in the Brandwein edition), a rectification for anger:

The following is a remedy for someone who gets angry.

Anger betrays at least a temporary lapse in the individual's belief that G‑d runs the world…

Even though there is no explicit prohibition against anger in the Torah, it is nonetheless considered a most heinous sin, and the sages have even compared it to idolatry. This is because anger betrays at least a temporary lapse in the individual's belief that G‑d runs the world and is responsible for every occurrence in life. For if G‑d is responsible for everything, and everything G‑d does is good, how is it possible to get angry? It is only possible if the person feels, at least for that moment, that he knows better than G‑d what should be happening, and this is a subtle form of idolatry. He is considering his own understanding of how the world should be running superior to G‑d's.

My master, of blessed memory, before he departed for the life of the World to Come, wanted to teach all the members [of his following] a remedy for anger, but we did not merit to do it, since, because of our numerous sins, I forgot the full explanation. The gist of the matter, however, is this:

One should perform 151 fasts, corresponding to the numerical value of the word for "anger" [in Hebrew, "ca'as, spelled caf-ayin-samech] plus 1 for the value of the word itself [the kolel].

Rabbi Shneur Zalman of Liadi explains in the Tanya that all the fasts prescribed in the works of Kabbala for rectifying various sins do not constitute the substance of repentance, sincere regret for past deeds and resolve not to repeat them. Rather, they are intended, once the individual has already repented and been forgiven for his sin, to purify the soul from the damage the sin caused and to reinstate the individual in G‑d's favor. Furthermore, these fasts are essentially not practicable today since our constitutions are much weaker than those of previous generations. Instead, we are to redeem these fasts by giving charity.

There are three types of vengeance alluded to in the story of Pinchas: "by avenging", "My vengeance", and "I did not destroy the children of Israel in My vengeance". (Num. 25:11) During the morning prayers, one should meditate on the divine name Eh-yeh as it is spelled out with the letter hei, the numerical value of which is 151. During the afternoon prayers, one should meditate on the name Eh-yeh squared, which also equals 151. During the evening prayers, one should meditate on the divine names Ado-nai Elokim, the combined numerical values of which equal 151.

Rectifying … involves tracing it back to its source in this divine name…

This is explained in Shaar HaPesukim, and its parallel passage in Likutei Torah.

The idiom "vengeance" is mentioned three times in the verse.

"G‑d spoke to Moses, saying: Pinchas the son of Elazar, the son of Aaron, the priest, turned back My anger against the children of Israel by avenging My vengeance against them. I therefore did not destroy the children of Israel in My vengeance." (Ibid.)

[The numerical value of the root of this word, "vengeance", spelled kuf-nun-alef, is 151, and is derived in three ways:] The numerical value of the divine name Eh-yeh, when spelled out using the letter hei is 151.

As we have explained previously, the divine names may be spelled out in various ways, depending on how the letters hei and vav are spelled. In the case of the name Eh-yeh (alef-hei-yud-hei), if the two letters hei are spelled out hei-hei, we have:

alef

alef

1

lamed

30

pei

80

hei

hei

5

hei

5

yud

yud

10

vav

6

dalet

4

hei

hei

5

hei

5

.

.

151

Spelling out ("milui" in Hebrew) signifies the fulfillment of latent potential, similar to the birth of a fetus hidden within the womb. Thus, in a certain sense, anger is the psychological fulfillment of the name Eh-yeh, and rectifying it involves tracing it back to its source in this divine name. This will be explained further on.

Furthermore, the numerical of the name Eh-yeh squared is also 151.

If we take the sum of the squares of each of the four letters that compose this name, we have 12 + 52 + 102 + 52 = 1 + 25 + 100 + 25 = 151. This technique, called "ribua perati" ("individual squaring"), signifies maturation and development, similar to the way a child matures (hopefully) as he grows into an adult. This is because squaring a number makes that number inter-include all its constituent units, and maturity means being able to see all sides of an issue and grant validity to other people.

Finally, the combined numerical values of the names Elokim and Ado-nai are 151.

Elokim: alef-lamed-hei-yud-mem (1+30+5+10+40 = 86); Ado-nai: alef-nun-dalet-yud (1+50+4+10 = 65). 65+86 = 151. The name Elokim signifies G‑d's attribute of judgment and severity, while the name Ado-nai signifies His attribute of authority and dominion ("adon", in Hebrew, means "master" or "ruler"). When these two divine attributes are combined, this also can produce anger, and thus the rectification of anger involves as well tracing it back to these two attributes in the soul, as will be explained further on.

These three aspects of vengeance are alluded to in the verse: "I descended to the garden of nuts." (Songs 6:11) The numerical value of the word for "garden of" [in Hebrew "ginat", gimel-nun-tav] is 453, which is 3 times 151.

In Kabbala, the nut symbolizes the phenomenon of evil surrounding holiness, just as the shells of the nut surround the inner meat. Here, too, anger is a shell which must be discarded, and in so doing one reveals the inner goodness of the soul.

This is the end of this passage in Shaar HaPesukim and its parallel passage in Likutei Torah.

(I am not sure if he told us to do it this way or oppositely, that is, to meditate on what is said above regarding the evening prayers during the afternoon prayers and vice versa.)

By changing the vowels…one is filling the vessel with various types of light…

The way this is done is as follows. We shall explain with regard to how one meditates during the morning prayers of the 151 fast days, and from this you will understand how to meditate during the other prayers. On the first fast day, you should meditate [during the morning prayers] on the letter alef. During the next thirty fast days, you should meditate [during the morning prayers] on the letter lamed [whose numerical value is 30], this being the second letter of the spelling-out of the letter alef [i.e., the first letter of the name Eh-yeh]. During the next eighty fast days, you should meditate [during the morning prayers] on the letter pei [whose numerical value is 80], this being the third letter of the spelling-out of the letter alef. In this way you should meditate [on the remaining letters of the spelling-out of the name Eh-yeh] for the duration of the 151 fast days.

Schematically, this would look like this:

morning prayer

alef
1

lamed
30

pei
80

hei
5

hei
5

yud
10

vav
6

dalet
4

hei
5

hei
5

afternoon prayer

alef
12

hei
25

yud
100

hei
25

evening prayer

alef
1

dalet
4

nun
50

yud
10

alef
1

lamed
30

hei
5

yud
10

mem
40

I do not remember which vowels to use when meditating on these names.

Although every name of G‑d has its natural vocalization, these names may be visualized as being vocalized with other vowels (since, after all, one does not pronounce these names while meditating on them, but merely visualizes and contemplates them). In Kabbala, the vowels signify the light that fills the vessels (signified by the letters). By changing the vowels, then, one is filling the vessel with various types of light.

I also do not remember at which exact point in the prayers one is to perform these meditations. All I remember is that they are to be done during the prayers, as I said. If, however, one wishes to meditate on these ideas throughout the whole day, so much the better.

In order to assuage anger, it is also effective to meditate - when one becomes angry - on the name Eh-yeh spelled out with the letter hei. As mentioned above, the numerical value of this name is the same as that of the word for "anger" [with the kolel].

From this remedy we see that prayer is an integral part of the process of rectifying anger. Furthermore, all three aspects of anger must be addressed: the fulfillment of the name Eh-yeh, the maturation of the name Eh-yeh, and the combination of the names Elokim and Ado-nai.

For another approach, also from the Ari, see Anger Remedy No. 2 (click here).