The Prophet ﷺ used to say, "Praise be to Allah in every circumstance. My Lord, I seek refuge in You from the state of the people of the Fire."
حدثنا علي بن محمد حدثنا وكيع عن موسى بن عبيدة عن محمد بن ثابت
أن النبي ﷺ كان يقول الحمد لله على كل حال رب أعوذ بك من حال أهل النار
Its isnad is daif. Ibn Adi narrated it (6/2335) from the hadith of Waki with this chain. See also hadith 251 regarding the status of Musa bin Ubayda. Muhammad bin Thabit is majhul (unknown), as stated by Busiri and the author of Taqrib.