The Messenger of Allah ﷺ said, "I marvel at the affair of the believer. Indeed, every matter of the believer is good for him, and that is not the case for anyone except the believer. If prosperity reaches him, he is grateful, and that is good for him. If hardship strikes him, he is patient, and that is good for him."
حدثنا بهز وحجاج قالا ثنا سليمان بن المغيرة عن ثابت عن عبد الرحمن بن أبي ليلى
قال رسول الله ﷺ عجبت من أمر المؤمن إن أمر المؤمن كله له خير وليس ذلك لأحد إلا للمؤمن إن أصابته سراء شكر كان ذلك له خيرا وإن أصابته ضراء فصبر كان ذلك له خيرا
Its isnad is sahih, its narrators are trustworthy and well-known figures. The hadith was narrated by Muslim, 4/2295, no. 2999, in the chapter on asceticism, "The believer's affair is all good," and by Darimi, 2/409, no. 2777, and by Tayalisi, 1/28, no. 44, al-Minhah, and by Tabarani in al-Kabir, 8/47, no. 7315.