Seeking Refuge with Allah when One is Angry
In his Musnad, Al-Hafiz Abu Ya`la Ahmad bin `Ali bin Al-Muthanna Al-Mawsili reported that Ubayy bin Ka`b said, "Two men disputed with each other in the presence of the Messenger of Allah and the nose of one of them became swollen because of extreme anger. The Messenger of Allah said,
«إِنِّي لَأَعْلَمُ شَيْئًا لَوْ قَالَهُ لَذَهَبَ عَنْهُ مَا يَجِدُ: أَعُوذُ بِاللهِ مِنَ الشَّيْطَانِ الرَّجِيمِ»
(I know of some words that if he said them, what he feels will go away, 'I seek refuge with Allah from the cursed Satan.')''
An-Nasa'i also recorded this Hadith in his book, Al-Yawm wal-Laylah.
Al-Bukhari recorded that Sulayman bin Surad said, "Two men disputed in the presence of the Prophet while we were sitting with him. One of them was cursing the other fellow and his face turned red due to anger. The Prophet said,
«إِنِّي لَأَعْلَمُ كَلِمَةً لَوْ قَالَهَا لَذَهَبَ عَنْهُ مَا يَجِدُ، لَوْ قَالَ: أَعُوذُ بِاللهِ مِنَ الشَّيْطَانِ الرَّجِيمِ»
(I know of a statement which if he said it, will make what he feels disappear, `I seek refuge with Allah from the cursed Satan.') They said to the man, `Do you not hear what the Messenger of Allah is saying' He said, `I am not insane.''' Also, Muslim, Abu Dawud and An-Nasa'i recorded this Hadith.
There are many other Hadiths about seeking refuge with Allah. One can find this subject in the books on supplication and the virtues of righteous, good deeds.