Suhaib reported that Allah's Messenger (salallahu 'alaihi wassalam) said:
Strange are the ways of a believer for there is good in every affair of
his and this is not the case with anyone else except in the case of a
believer for if he has an occasion to feel delight, he thanks (Allah),
thus there is a good for him in it, and if he gets into trouble and
shows resignation (and endures it patiently), there is a good for him in
it [Hadith from the Translation of Sahih Muslim, Book 42: Kitab Al-Zuhd Wa Al-Raqa'iq (Book Pertaining To Piety And Softening Of Hearts), Chapter 14: Every Act Of A Believer Is A Blessing For Him, Number 7138].