I heard the Prophet ﷺ say, "I marvel at the believer. Allah does not decree anything for him except that it is good for him."
حدثنا يحيى عن سفيان قال حدثني القاسم بن شريح عن ثعلبة قال سمعت
سمعت النبي ﷺ يقول عجبت للمؤمن إن الله لم يقض قضاء إلا كان خيرا له
Its isnad is sahih. Qasim bin Shurayh was approved of by Abu Hatim, and Ibn Hibban mentioned him among the trustworthy, while Bukhari mentioned only his name in Tarikh al-Kabir. The same applies to Thalaba, who is Ibn Malik, though some say Ibn Hakam, and others say Ibn Aasim. He is Abu Bahr, the freedman of Anas, and Abu Hatim regarded him as acceptable, while Ibn Hibban mentioned him among the trustworthy. Haythami graded it sahih in al-Majma 7/210. It is found in Abu Yaala through the route of Thalaba, 7/221, number 4218, and in Ibn Hibban, 2/507, number 728, where he is named Thalaba bin Aasim.The hadith is explained in Sahih Muslim with the wording, "How amazing is the affair of the believer," 4/2295, number 2999.