The Prophet ﷺ said, "Hasten to do good deeds before tribulations come like patches of dark night. A man will wake up as a believer and go to bed as a disbeliever, or go to bed as a believer and wake up as a disbeliever, selling his faith for a trifle of worldly gain."
حدثنا سليمان أنبأنا إسماعيل أخبرني العلاء عن أبيه
أن النبي ﷺ قال بادروا فتنا كقطع الليل المظلم يصبح الرجل مؤمنا ويمسي كافرا ويمسي مؤمنا ويصبح كافرا يبيع دينه بعرض من الدنيا
Its isnad is sahih. It is likewise found in Muslim 1/110, no. 118, in the Book of Faith, chapter on urging haste in performing good deeds, and in Tirmidhi 4/487, no. 2195, in the Book of Tribulations, chapter on what has been said about tribulations coming like pieces of the night, where he said, hasan sahih.