Jami` at-Tirmidhi, Book 48, Hadith 67 (In-Book) ⓘ
Abu Hurairah narrated that: When a matter would worry the Prophet, he would raise his head up toward the sky and say: “Glory is to Allah, the Magnificent (Subḥān Allāhil-`Aẓīm).” And when he would strive in supplication; he would say: “O the Living, O Sustainer (Yā Ḥayyu yā Qayyūm).”
حَدَّثَنَا أَبُو سَلَمَةَ، يَحْيَى بْنُ الْمُغِيرَةِ الْمَخْزُومِيُّ الْمَدَنِيُّ وَغَيْرُ وَاحِدٍ قَالُوا حَدَّثَنَا ابْنُ أَبِي فُدَيْكٍ، عَنْ إِبْرَاهِيمَ بْنِ الْفَضْلِ، عَنِ الْمَقْبُرِيِّ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ النَّبِيَّ صلى الله عليه وسلم كَانَ إِذَا أَهَمَّهُ الأَمْرُ رَفَعَ رَأْسَهُ إِلَى السَّمَاءِ فَقَالَ " سُبْحَانَ اللَّهِ الْعَظِيمِ " . وَإِذَا اجْتَهَدَ فِي الدُّعَاءِ قَالَ " يَا حَىُّ يَا قَيُّومُ " . قَالَ أَبُو عِيسَى هَذَا حَدِيثٌ حَسَنٌ غَرِيبٌ .
also referenced under: Hadith 3436 (Reference) & Volume 6, Book 45, Hadith 3436 (DarusSalam)