The Messenger of Allah ﷺ said, "How remarkable is the affair of the believer. All of his affairs are good, and this is not the case for anyone 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 it patiently, and that too is good for him."
قال رسول الله ﷺ: عجبا لأمر المؤمن، إن أمره كله خير، وليس ذاك لأحد إلا للمؤمن؛ إن أصابته سراء شكر فكان خيرا له، وإن أصابته ضراء صبر فكان خيرا له.
Muslim narrated it in Zuhd and Raqaiq (2999) from Haddab bin Khalid Azdi and Shayban bin Farroukh, both from Sulayman bin Mughira, who said, Thabit narrated to us, from Abdul-Rahman bin Abu Layla, from Suhayb, and he related it.Bayhaqi recorded it (3/375) through the route of Ahmad bin Nadr bin Abdul-Wahhab, from Shayban bin Farroukh, with his chain of transmission, and he added at the end, "so every decree of Allah for the Muslims is good."