The Messenger of Allah ﷺ said, "When Allah intends good for a servant, He puts him to use."Someone asked, "How does He put him to use, Messenger of Allah?"He replied, "He grants him success in performing a righteous deed before death."
قال رسول الله ﷺ: إذا أراد الله بعبد خيرا استعمله. فقيل: كيف يستعمله يا رسول الله؟ قال: يوفقه لعمل صالح قبل الموت.
Tirmidhi (2142) narrated it from Ali bin Hajar, who said, "Ismail bin Jafar told us, from Humayd, from Anas," and he mentioned the same. Its isnad is sahih. Ibn Hibban (341) and Hakim (1/340) both graded it sahih, both by way of Ismail bin Jafar, with his isnad, the same. Tirmidhi said, "A sahih hadith." Hakim said, "Sahih according to the criteria of the two Shaikhs."