The Prophet said:
Wondrous are the affairs of the believer. His affairs are all good, and this is only the case for the believer. When something pleasing happens to him, he is thankful, and it is good for him. When something harmful happens to him, he is patient, and it is good for him.