Sunan Ibn Majah, Book 33, Hadith 148 (Ibn Majah 3806)

It was narratd from Abu Hurairah that :

the Prophet (ﷺ) used to say: "Al-hamdu lillahi 'ala kulli hal. Rabbi a'udhu bika min hali ahlin-nar (Praise is to Allah in all circumstances, O Allah, I seek refuge with You from the situation of the people of Hell)."