It is related from Anas (may Allah be pleased with him) that whenever a matter weighed upon the Prophet ﷺ he would say: ya ḥayy, ya qayyūm, bi-raḥmatika astaghīth (O Ever-Living, O Sustainer, by Your mercy I seek relief).
Abu Hurayrah (may Allah be pleased with him) narrated that when something concerned the Prophet ﷺ he would raise his head toward the sky and say: subḥāna Allāh al-ʿaẓīm (Glory be to Allah, the Tremendous); and when he became earnest in supplication he would say: ya ḥayy, ya qayyūm (O Ever-Living, O Sustainer). Both reports were recorded by al-Tirmidhī.
Abu Bakrah (may Allah be pleased with him) reported that the Messenger of Allah ﷺ said: “The supplication of the distressed is: Allāhumma raḥmataka arjū, fa-lā takilnī ilā nafsī ṭarfata ʿayn, wa-aṣliḥ lī shaʾnī kullah, lā ilāha illā Ant (O Allah, it is Your mercy that I hope for; do not leave me to myself for the blink of an eye; set right all of my affairs; there is no god but You).”
ʿAsmāʾ bint ʿUmays (may Allah be pleased with her) said: The Messenger of Allah ﷺ told me, “Shall I not teach you some words to say at the time of distress—or in distress? Say: Allāh, Allāh rabbī, lā ushriku bihī shayʾan (Allah, Allah is my Lord; I associate nothing with Him).” In another version it is stated that the phrase should be repeated seven times. Both narrations were recorded by Abū Dāwūd.
Saʿd ibn Abī Waqqāṣ (may Allah be pleased with him) said, “The Messenger of Allah ﷺ said …”