How to Control Anger in Islam
Question

I have a bad temper, if I get mad or upset, I move away from the situation, when I was standing I would sit down, when I was sitting I would lie down, and I have recited the "darud" and "laholawallah kuwatta", but to no avail.
How does one control their temper then?
Praise be to Allah.How to control anger
Anger is one of the evil whispers of Shaytan, which leads to so many evils and tragedies, of which only Allah knows their full extent. For this reason Islam has a great deal to say about this bad characteristic, and the Prophet (peace and blessings of Allah be upon him) described cures for this "disease" and ways to limit its effects, among which are the following:
Seeking refuge with Allah from the Shaytan
Sulayman ibn Sard said: "I was sitting with the Prophet (peace and blessings of Allah be upon him), and two men were slandering one another. One of them was red in the face, and the veins on his neck were standing out. The Prophet (peace and blessings of Allah be upon him) said, ‘I know a word which, if he were to say it, what he feels would go away. If he said "I seek refuge with Allah from the Shaytan," what he feels (i.e., his anger) would go away.’" (Reported by al-Bukhari, al-Fath, 6/337)

The Prophet (peace and blessings of Allah be upon him) said: "If a man gets angry and says, ‘I seek refuge with Allah ,’ his anger will go away." (Sahih al-Jami’ al-Saghir, no. 695)
Keeping silent
The Messenger of Allah (peace and blessings of Allah be upon him) said: "If any of you becomes angry, let him keep silent." (Reported by Imam Ahmad, al-Musnad, 1/329; see also Sahih al-Jami’, 693, 4027)

This is because, in most cases, the angry person loses self-control and could utter words of kufr/disbelief (from which we seek refuge with Allah), or curses, or the word of divorce (talaq) which would destroy his home, or words of slander which would bring him the enmity and hatred of others. So, in short, keeping silent is the solution which helps one to avoid all that.
Not moving
The Messenger of Allah (peace and blessings of Allah be upon him) said: "If any of you becomes angry and he is standing, let him sit down, so his anger will go away; if it does not go away, let him lie down."

The narrator of this hadith is Abu Dharr (may Allah be pleased with him), and there is a story connected to his telling of it: he was taking his camels to drink at a trough that he owned, when some other people came along and said (to one another), "Who can compete with Abu Dharr (in bringing animals to drink) and make his hair stand on end?" A man said, "I can," so he brought his animals and competed with Abu Dharr, with the result that the trough was broken. [i.e., Abu Dharr was expecting help in watering his camels, but instead the man misbehaved and caused the trough to be broken]. Abu Dharr was standing, so he sat down, then he laid down. Someone asked him, "O Abu Dharr, why did you sit down then lie down?" He said: "The Messenger of Allah (peace and blessings of Allah be upon him) said: . . ." and quoted the hadith. (The hadith and this story may be found in Musnad Ahmad, 5/152; see also Sahih al-Jami’, no. 694).

According to another report, Abu Dharr was watering his animals at the trough, when another man made him angry, so he sat down . . . (Fayd al-Qadir, al-Manawi, 1/408)

Among the benefits of this advice given by the Prophet (peace and blessings of Allah be upon him) is the fact that it prevents the angry person from going out of control, because he could strike out and injure someone, or even kill - as we will find out shortly - or he could destroy possessions and so on. Sitting down makes it less likely that one will become overexcited. Lying down makes it even less likely that he will do something crazy or harmful.
Al-’Allamah al-Khattabi, may Allah have mercy on him, said in his commentary on Abu Dawud:
"One who is standing is in a position to strike and destroy, while the one who is sitting is less likely to do that, and the one who is lying down can do neither. It is possible that the Prophet (peace and blessings of Allah be upon him) told the angry person to sit down or lie down so that he would not do something that he would later regret. And Allah knows best." (Sunan Abi Dawud, with Ma'alim al-Sunan, 5/141)
Following the advice of the Prophet (peace and blessings of Allah be upon him)
Abu Hurayrah, may Allah be pleased with him, reported that a man said to the Prophet (peace and blessings of Allah be upon him), "Advise me." He said, "Do not become angry." The man repeated his request several times, and each time the Prophet (peace and blessings of Allah be upon him) told him, "Do not become angry." (Reported by al-Bukhari, Fath al-Bari, 10/456)

According to another report, the man said: "I thought about what the Prophet (peace and blessings of Allah be upon him) said, and I realized that anger combines all kinds of evil." (Musnad Ahmad, 5/373)
Do not become angry and Paradise will be yours 
This is an authentic hadith. (See Sahih al-Jami’, 7374. Ibn Hijr attributed it to al-Tabarani, see al-Fath 4/465)
Remembering what Allah has promised to the righteous (muttaqin) who keep away from the causes of anger and struggle within themselves to control it, is one of the most effective ways of extinguishing the flames of anger. One of the hadiths that describe the great reward for doing this is: "Whoever controls his anger at the time when he has the means to act upon it, Allah will fill his heart with contentment on the Day of Resurrection." (Reported by al-Tabarani, 12/453, see also Sahih al-Jami’, 6518).

Another great reward is described in the Prophet’s words: "Whoever controls his anger at the time when he has the means to act upon it, Allah will call him before all of mankind on the Day of Resurrection, and will let him choose of the Hur al-’Iyn whoever he wants." (Reported by Abu Dawud, 4777, and others. It is classified as hasan (sound) in Sahih al-Jami’, 6518)
Knowing the high status and advantages offered to those who control themselves
The Messenger of Allah (peace and blessings of Allah be upon him) said: "The strong man is not the one who can overpower others (in wrestling); rather, the strong man is the one who controls himself when he gets angry." (Reported by Ahmad, 2/236; the hadith is agreed upon). 
The greater the anger, the higher the status of the one who controls himself. The Prophet (peace and blessings of Allah be upon him) said: "The strongest man is the one who, when he gets angry and his face reddens and his hackles rise, is able to defeat his anger." (Reported by Imam Ahmad, 5/367, and classified as hasan in Sahih al-Jami’, 3859)

Anas reported that the Prophet (peace and blessings of Allah be upon him) passed by some people who were wrestling. He asked, "What is this?" They said: "So-and-So is the strongest, he can beat anybody." The Prophet (peace and blessings of Allah be upon him) said, "Shall I not tell you who is even stronger than him? The man who, when he is mistreated by another, controls his anger, has defeated his own shaytan and the shaytan of the one who made him angry." (Reported by al-Bazzar, and Ibn Hijr said its isnad is sahih. Al-Fath, 10/519)
Following the Prophet’s example in the case of anger
The Prophet (peace and blessings of Allah be upon him) is our leader and has set the highest example in this matter, as is recorded in a number of hadiths. One of the most famous was reported by Anas, may Allah be pleased with him, who said: "I was walking with the Messenger of Allah (peace and blessings of Allah be upon him), and he was wearing a Najrani cloak with a rough collar. A Bedouin came and seized him roughly by the edge of his cloak, and I saw the marks left on his neck by the collar. Then the Bedouin ordered him to give him some of the wealth of Allah that he had. The Prophet (peace and blessings of Allah be upon him) turned to him and smiled, then ordered that he should be given something." (Agreed upon. Fath al-Bari, 10/375)

Another way in which we can follow the example of the Prophet (peace and blessings of Allah be upon him) is by making our anger for the sake of Allah, when His rights are violated. This is the kind of anger which is praiseworthy. So the Prophet (peace and blessings of Allah be upon him) became angry when he was told about the imam who was putting people off the prayer by making it too long; when he saw a curtain with pictures of animate creatures in ‘Aishah’s house; when Usamah spoke to him about the Makhzumi woman who had been convicted of theft, and he said "Do you seek to intervene concerning one of the punishments prescribed by Allah?"; when he was asked questions that he disliked, and so on. His anger was purely for the sake of Allah.
Knowing that resisting anger is one of the signs of righteousness
The righteous (al-muttaqun) are those praised by Allah in the Quran and by His Messenger (peace and blessings of Allah be upon him). Paradise as wide as heaven and earth has been prepared for them. One of their characteristics is that they (interpretation of the meaning) "spend (in Allah’s Cause) in prosperity and in adversity, [they] repress anger, and [they] pardon men; verily, Allah loves al-muhsinun (the good-doers)." [Al ‘Imran 3:134]

These are the ones whose good character and beautiful attributes and deeds Allah has mentioned, and whom people admire and want to emulate. One of their characteristics is that (interpretation of the meaning) ". . . when they are angry, they forgive." [al-Shura 42:37]
Listening to reminders
Anger is a part of human nature, and people vary in their anger. It may be difficult for a man not to get angry, but sincere people will remember Allah when they are reminded, and they will not overstep the mark. Some examples follow:

Ibn `Abbas (may Allah be pleased with him) reported that a man sought permission to speak to ‘Umar ibn al-Khattab (may Allah be pleased with him), then he said: "O son of al-Khattab, you are not giving us much and you are not judging fairly between us." ‘Umar (may Allah be pleased with him) was so angry that he was about to attack the man, but al-Hurr ibn Qays, who was one of those present, said: "O Amir al-Mu’minin, Allah said to His Prophet (peace and blessings of Allah be upon him) (interpretation of the meaning): ‘Show forgiveness, enjoin what is good, and turn away from the foolish’ [al-A’raf 7:199]. This man is one of the foolish." By Allah, ‘Umar could go no further after al-Hurr had recited this ayah to him, and he was a man who was careful to adhere to the Book of Allah. (Reported by al-Bukhari, al-Fath, 4/304)

This is how the Muslim should be. The evil hypocrite was not like this when he was told the hadith of the Prophet (peace and blessings of Allah be upon him) and one of the Companions said to him, "Seek refuge with Allah from the Shaytan." He said to the one who reminded him, "Do you think I am crazy? Go away!" (Reported by al-Bukhari, al-Fath, 1/465). We seek refuge with Allah from failure.
Knowing the bad effects of anger
The negative effects of anger are many; in short they cause damage to one’s own self and to others. The angry person may utter words of slander and obscenity, he may attack others (physically) in an uncontrolled manner, even to the point of killing. The following story contains a valuable lesson:

`Alqamah ibn Wail reported that his father (may Allah be pleased with him) told him: "I was sitting with the Prophet (peace and blessings of Allah be upon him) when a man came to him leading another man by a rope. He said, ‘O Messenger of Allah, this man killed my brother.’ The Messenger of Allah (peace and blessings of Allah be upon him) asked him, ‘Did you kill him?’ He said, ‘Yes, I killed him.’ He asked, ‘How did you kill him?’ He said, ‘He and I were hitting a tree to make the leaves fall, for animal feed, and he slandered me, so I struck him on the side of the head with an axe, and killed him.’ . . ." (Reported by Muslim, 1307, edited by al-Baqi)

Anger could lead to less than killing, such as wounding and breaking bones. If the one who caused the anger runs away, the angry person turns his anger on himself, so he may tear his clothes, or strike his cheeks, or have a fit, or fall unconscious, or he may break dishes and plates, or break furniture.

In the worst cases, anger results in social disasters and the breaking of family ties, i.e., divorce. Ask many of those who divorced their wives, and they will tell you: it was in a moment of anger. This divorce results in misery for the children, regret and frustration, a hard and difficult life, all as a result of anger. If they had remembered Allah, come to their senses, restrained their anger and sought refuge with Allah, none of this would have happened. Going against the shari’ah (Islamic law) only results in loss.

The damage to health that results from anger can only be described by doctors, such as thrombosis, high blood pressure, tachycardia (abnormally rapid heartbeat) and hyperventilation (rapid, shallow breathing), which can lead to fatal heart attacks, diabetes, etc. We ask Allah for good health.
The angry person should think about himself during moments of anger
If the angry person could see himself in the mirror when he is angry, he would hate himself and the way he looks. If he could see the way he changes, and the way his body and limbs shake, how his eyes glare and how out of control and crazy his behaviour is, he would despise himself and be revolted by his own appearance. It is well-known that inner ugliness is even worse than outer ugliness; how happy the Shaytan must be when a person is in this state! We seek refuge with Allah from the Shaytan and from failure.
Du`a (Supplication)
Du`a is always the weapon of the believer, whereby he asks Allah to protect him from evil, trouble and bad behaviour and seeks refuge with Him from falling into the pit of kufr (disbelief) or wrongdoing because of anger. One of the three things that can help save him is: being fair at times of contentment and of anger (Sahih al-Jami’, 3039). One of the Du`as of the Prophet (peace and blessings of Allah be upon him) was:

"O Allah, by Your knowledge of the Unseen and Your power over Your creation, keep me alive for as long as You know life is good for me, and cause me to die when You know death is good for me. O Allah, I ask You to make me fear You in secret and in public, and I ask You to make me speak the truth in times of contentment and of anger. I ask You not to let me be extravagant in poverty or in prosperity. I ask You for continuous blessings, and for contentment that does not end. I ask You to let me accept Your decree, and for a good life after death. I ask You for the joy of seeing Your face and for the longing to meet You, without going through diseases and misguiding fitnah (trials). O Allah, adorn us with the adornment of faith and make us among those who are guided. Praise be to Allah, the Lord of the Worlds."
For more about issues related to anger, please see these answers: 42505 , 22034 and 82400 .
And Allah knows best.