What to Say When Startled Awake
...
130 / WHAT TO SAY WHEN FRIGHTENED IN ONE’S SLEEP
Among the great and beneficial remembrances for someone who is terrified in a dream, experiences dread and anxiety, or is seized by fright in his sleep is to say whenever any of this occurs: “I seek refuge in the perfect words of Allah from His wrath and punishment, from the evil of His servants, and from the promptings of the devils and their presence.”
Abū Dāwūd, al-Tirmidhī, and others narrated from Abd Allah ibn Amr ibn al-Ās—may Allah be pleased with them both—that the Messenger of Allah—peace and blessings be upon him—said: “When any one of you is frightened in his sleep, let him say: ‘I seek refuge in the perfect words of Allah from His wrath and punishment, from the evil of His servants, and from the promptings of the devils and their presence,’ for it will never harm him.”1
Imam Ahmad related in his Musnad from al-Walīd ibn al-Walīd—may Allah be pleased with him—that he said, “O Messenger of Allah—peace and blessings be upon him—I experience a sense of dread.” He replied: “When you go to bed, say: ‘I seek refuge in the perfect words of Allah from His wrath and punishment, from the evil of His servants, and from the promptings of the devils and their presence.’ It will not harm you and, most likely, will not even come near you.”2
Mālik related in al-Muwatta from Yahyā ibn Saīd, who said: “It has reached me that Khālid ibn al-Walīd said to the Messenger of Allah—peace and blessings be upon him—‘I am terrified in my sleep.’ The Messenger of Allah—peace and blessings be upon him—said to him: ‘Say: I seek refuge in the perfect words of Allah from His wrath and punishment, from the evil of His servants, and from the promptings of the devils and their presence.’”3