Ibn ‘Abbas reported, “The Prophet, peace be upon him, at times of sorrow and grief used to supplicate, La iliha illa Allah Al-‘Azim, Al-‘Alim, la ilaha illa Allah, Rabbul ‘arshil ‘Azim, la ilaha illa Allahu, Rabbus-Samawati wa rabbul ardi wa rabbul ‘arshi karim (There is no god but Allah, the Mighty, the Forbearing, there is no god but Allah, the Lord of the mighty throne, there is no god but Allah, the Lord of the heavens and the earth, and the Lord of the throne of honour)’.” This is reported by Bukhari and Muslim.
Anas said that when the Prophet, peace be upon him, was faced with a serious difficulty, he would always supplicate, “Ya Hayyu, ya Qayyumu, bi-rahmatika astaghithu (O the Living, O the Eternal, I seek help in Your grace). (Tirmizhi)
Abu Hurairah reported that whenever the Prophet, peace be upon him, was faced with a serious difficulty, he would raise his head to the sky and supplicate, “Subhan-Allah al-‘Azim (glory be to Allah, the Mighty).” And when he implored seriously and strongly, he would say “Ya Hayyu, Ya Qayyum (O the Living, the Eternal One).” (Tirmizhi)
Abu Bakrah reported that the Prophet, peace be upon him, said, “The supplications of distress are, ‘Allahumma rahmataka arju, fala takilni ila nafsi tarfata ‘ain, wa aslah li sha’ni kullahu, la ilaha illa anta (O Allah, I hope for Your mercy, so give me not over to my self even for as little as wink of an eye, and set right all my affairs, there is no god but You).” (Abu Daw’ud)
Asma, daughter of ‘Amais, reported that the Prophet, peace be upon him, asked her, “Shall I tell you words that you may say in times of pain or distress. These are, ‘Allah, Allah, Rabbi la ushriku bihi shai’an (Allah, Allah, my Lord, I associate none with Him).” Another narration says that these words should be said seven times. (Abu Daw’ud)
Sa’d ibn Waqas reported that the Prophet, peace be upon him, said, “The supplication made by the Companion of the Fish (Prophet Yunus) in the belly of the fish was, ‘La ilaha illa anta, subhanaka, inni kuntu minaz-zalimin (there is no god but You, You are far exalted and above all weaknesses, and I was indeed the wrongdoer)’.
If any Muslim supplicates in these words, his supplication will be accepted.” In another report we read, “I know words that will cause Allah to remove one’s distress. These are the words (of supplication) of my brother Yunus, peace be upon him,” (Tirmizhi)
Ibn Mas’ud reported that the Prophet, peace be upon him, said, “If any servant of Allah afflicted with distress or grief makes this supplication, his supplication will be accepted: ‘O Allah, I am Your servant, son of Your servant, son of your maidservant. My forehead is in Your hand. Your command concerning me prevails, and Your decision concerning me is just. I call upon You by every one of the beautiful names by which You have described Yourself, or which You have revealed in Your book, or have taught anyone of Your creatures, or which You have chosen to keep in the knowledge of the unseen with You, to make the Qur’an the delight of my heart, the light of my breast, and remover of my grief’s, sorrows, and afflictions’.” A supplication in these words will be answered. Allah will remove one’s affliction and replace it with joy and happiness. (Reported by Ahmad and Ibn Hibban)