Abdullah bin Masud reported,

The Messenger of Allah ﷺ said, "No servant is ever afflicted by anxiety, grief, or sorrow and then says, 'O Allah, I am Your servant, the son of Your male servant, the son of Your female servant. My forelock is in Your hand, Your judgment over me is ever executed, 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 sorrow, and the remover of my anxiety and grief,' except that Allah will remove his anxiety and grief and replace them with joy."They asked, "Messenger of Allah, should we not learn these words?"He replied, "Yes indeed. Whoever hears them ought to learn them."

Azami 243

Sahih

عن عبد الله بن مسعود قال

قال رسول الله ﷺ: ما أصاب عبدا قط هم ولا غم ولا حزن، فقال: اللهم إني عبدك، ابن عبدك، ابن أمتك، ناصيتي بيدك ماض في حكمك، عدل في قضاؤك، أسألك بكل اسم هو لك سميت به نفسك أو أنزلته في كتابك، أو علمته أحدا من خلقك، أو استأثرت به في علم الغيب عندك أن تجعل القرآن ربيع قلبي، ونور صدري وجلاء حزني وذهاب همي وغمي، إلا أذهب الله همه وغمه، وأبدله مكانه فرحا قالوا: يا رسول الله، أفلا نتعلمهن؟ قال: بلى، ينبغي لمن يسمعهن أن يتعلمهن.

الأعظمي 243صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Faith
Chapter
Faith in Allah عز وجل
Section
"And to Allah belong the most beautiful names," and they are divinely ordained, Allah revealed them to His servants for knowledge, supplication, and remembrance
Numbering
Jami al-Kamil 243 (2nd edition)
Azami 243