The Messenger of Allah ﷺ said, "No servant is ever afflicted with anxiety, grief, or sorrow and then says, 'O Allah, I am Your servant, the son of Your servant, the son of Your maidservant. My forelock is in Your hand. Your judgment over me is binding, and Your decree concerning me is just. I ask You by every name that belongs to You, by which You have named Yourself, or which You have revealed in Your Book, or which You have taught to any of Your creation, or which You have kept hidden in the knowledge of the unseen with You, that You make the Quran the springtime of my heart, the light of my chest, the dispeller of my grief, and the remover of my anxiety and sorrow,' except that Allah removes his anxiety and grief and replaces it with joy."They asked, "Messenger of Allah, should we not learn these words?"He replied, "Yes indeed, whoever hears them ought to learn them."
قال رسول الله ﷺ: ما أصاب عبدا قط هم ولا غم ولا حزن، فقال: اللهم إني عبدك، ابن عبدك، ابن أمتك، ناصيتي بيدك، ماض في حكمك، عدل في قضاؤك، أسألك بكل اسم هو لك، سميت به نفسك، أو أنزلته في كتابك، أو علمته أحدا من خلقك، أو استأثرت به في علم الغيب عندك، أن تجعل القرآن ربيع قلبي، ونور صدري، وجلاء حزني، وذهاب همي وغمي، إلا أذهب الله همه وغمه، وأبدله مكانه فرحا قالوا: يا رسول الله، أفلا نتعلمهن؟ قال: بلى، ينبغي لمن يسمعهن أن يتعلمهن.
Ahmad (3712), Abu Yaala (5297), Tabarani in Al-Kabir (10/209–210), and Bayhaqi in Al-Asma wal-Sifat (7) all narrated it, and Ibn Hibban (972) and Hakim (1/509) graded it sahih, all of them by way of Fudayl bin Marzuk, who said, Abu Salama Juhani narrated to us, from Qasim bin Abdul-Rahman, from his father, from Ibn Masud, who mentioned it. The discussion of this is given at length in the Book of Faith.As for what is reported from Anas bin Malik, who said, "Whenever a matter distressed the Prophet ﷺ, he would say, 'O Ever-Living, O Sustainer, by Your mercy I seek relief,'" its chain is daif. Tirmidhi (3534) and Ibn Sunni in Amal al-Yawm wal-Layla (338) both narrated it by way of Shuja bin Walid, from Raheel bin Muawiya, brother of Zuhayr bin Muawiya, from Yazid Raqashi, from Anas bin Malik, who mentioned it. Yazid Raqashi is Ibn Aban Basri the storyteller, and he is daif.Likewise, what is reported from Ibn Masud is not sahih, that he said, "Whenever the Messenger of Allah ﷺ was afflicted with worry or grief, he would say, 'O Ever-Living, O Sustainer, by Your mercy I seek relief.'" Hakim (1/509) narrated it, and from him Bayhaqi in Al-Dawat (190), by way of Nadr bin Ismail Bajali, from Abdul-Rahman bin Ishaq, from Qasim bin Abdul-Rahman, from his father, from Ibn Masud, who mentioned it. Hakim said, "This is a hadith sahih in its chain." Dhahabi took issue with him, saying, "Abdul-Rahman did not hear from his father, and Abdul-Rahman and those after him are not to be relied upon."I say, whether Abdul-Rahman bin Masud heard from his father is a matter of dispute, and his statement, "Abdul-Rahman and those after him are not to be relied upon," refers to Abdul-Rahman bin Ishaq, who is Wasiti, daif by agreement of the hadith scholars, while Nadr bin Ismail Bajali is not strong.This chain has also been contradicted, for Hafs bin Ghiyath, who is trustworthy, narrated it from Abdul-Rahman bin Ishaq, from Qasim bin Abdul-Rahman, from Ibn Masud. Bayhaqi extracted this narration in Al-Asma wal-Sifat (215), but Qasim bin Abdul-Rahman did not hear from Ibn Masud. Bayhaqi said, "This, despite its being a broken chain, is more sound."I say, both routes hinge on Abdul-Rahman bin Ishaq, who is Wasiti, agreed upon as daif.Likewise, what is reported from Abu Hurairah is not sahih, that the Prophet ﷺ, whenever a matter distressed him, would raise his head to the sky and say, "Glory be to Allah the Magnificent," and when he exerted himself in supplication, he would say, "O Ever-Living, O Sustainer." Its chain is very daif. Tirmidhi (3436) narrated it, and Abu Yaala (6546), and from him Ibn Sunni in Amal al-Yawm wal-Layla (339), and Ibn Adi in Al-Kamil (1/232), all of them through routes from Ibn Abu Fudayk, from Ibrahim bin Fadl, from Maqburi, from Abu Hurairah, who mentioned it. The wording given is Tirmidhi's. Tirmidhi said, "This is a gharib hadith."I say, it is as he said, for its chain contains Ibrahim bin Fadl, who is Abu Ishaq Makhzumi Madani, and he is discarded as a narrator.