The Messenger of Allah ﷺ said, "How remarkable is the affair of the believer. Every matter that befalls him is good for him, and this is true of no one except the believer. If something pleasing happens to him, he gives thanks, and that is good for him. If something harmful befalls him, he endures with patience, and that too is good for him."
حدثنا عفان من كتابه حدثنا سليمان حدثنا ثابت عن ابن أبي ليلى
قال رسول الله ﷺ عجبت لأمر المؤمن إن أمر المؤمن كله له خير ليس ذلك لأحد إلا للمؤمن إن أصابته سراء شكر وكان خيرا وإن أصابته ضراء صبر وكان خيرا