Allah says: ‘And hasten to forgiveness from your Lord, and to a garden broad as the heavens and the earth, prepared for those who are mindful (of God): those who spend in good times and bad, and those who restrain anger, and those who forgive people; - and Allah loves those who do good.” (Qur’an: 3: 133-134).
And Allah says: " Hence, if it should happen that a prompting from Satan stirs thee up [to blind anger], seek refuge with God: Verily, He is the All-Hearing, All-Knowing!” (Qur’an: 41:36).
The Prophet (peace be upon him) said, “He is not strong who knocks out another in wrestling; rather, the strongest is the who restrains his or her anger.” (Reported by Muslim on the authority of Ibn Mas’ud).
Imam Ghazali in his masterpiece Ihya considers anger as the cause of many evils in the world: wars, murder, the breakdown of the family, etc.
Therefore, it behooves us to work on ourselves to restrain ourselves. Anger is a natural instinct. It has a function or purpose: It is like a wake-up call to respond to a particular situation: So, when it is used to act or respond positively the results are beneficial; if however, it leads us to resort to violence, it ends us destroying us.
Islam teaches us to learn self-restraint and self-mastery. We can learn this through both cognitive and practical steps: the Cognitive aspect of anger management involves thinking of the negative aspects of anger when one fails to control or master it. And the actual steps entail both immediate and practical steps to counter it.
1. First seeking refuge and protection with Allah from Satan who is eager to use it as a vehicle to play havoc with our life. The Prophet (peace be upon him) advised one of his companions who was stirred up to anger to say: Aoodhu billahi mina al-sshaytaani al-rrajeem (I seek refuge in Allah from Satan the accursed).
2. Secondly, taking immediate action to cool down by performing ablutions or even taking a bath; perform two rak’ahs and even going for a walk.
On a long-term level, one should seek professional counseling. There is no shortage of courses that teach anger management tips. As Muslims, we are to benefit from all scientific methods that are beneficial in gaining emotional health and self-mastery. It is important for us to know that we cannot achieve success in life unless we can learn self-mastery.
Lastly, I would advise you to practice constancy in dhikr. Dhikr is the remembrance of Allah which is the key to peace of mind, tranquility, and salvation in both worlds. For this, there is no better way than emulating the spiritual method of the Prophet (peace be upon him).
I would urge you to get a copy of Invocation of God by Ibn al-Qayyim al-Jawziyya and study it and practice its lessons.