Shuraih  Al-Qaadhiy (rahimahullaah) said:

Indeed I get afflicted with a calamity, so I praise Allaah four times: I praise Him for not making the calamity greater than what it is; I praise Him for granting me patience; I praise Him for the reward I hope for in that calamity and I praise Him for not placing that calamity in the affairs of my religion. [Shu’ab Al-Eemaan 9507]