Authentic Supplication Number 126.

At times of distress the Messenger of Allah  would say La ‘ilaha ‘illa ‘allahu ‘al-`atheemu ‘al-haleemu, la ‘ilaha ‘illa ‘allahu rabbul `arshil-`atheemi, la ‘ilaha ‘illa ‘allahu rabbus-samawati wa rabbul-‘ardhi wa rabbul-`arshil-kareemi (147).

Footnotes.
(147) There is no ‘ilah except Allah The Magnificent, The Forbearing. There is no ‘ilah except Allah Lord of the Magnificent Throne. There is no ‘ilah except Allah Lord of the Heavens, Lord of the Earth, and Lord of the Noble Throne.

Reporters.
Agreed upon by Bukhari and Muslim and is #97 in The Authentic of Good Sayings.