It is recommended for anyone that has had a catastrophe of any kind befall him—or fears the occurrence of one—to first acknowledge all of the bounties [of Allāh] that have been granted to him both in terms of his dīn and this worldly life and compare this to whatever reviled occurrence he has been subjected to. It is by this comparison that he truly uncovers for himself the grandeur of the favours [of Allāh] upon him, and the paltriness and transient nature of the calamity he faces.
[For the one who fears a calamity that has not yet occurred], he should measure the likelihood of what he fears occurring by comparing it to the huge multitude of possibilities in which he is safe from such an occurrence. So let him not let a proposed catastrophe whose probability of occurrence is small overcome the likelihood of the many situations wherein he is safe [from what he fears]. Thus, his stress and consternation will dissipate. [Let him also] create for himself [in his mind] the greatest possible catastrophe that could befall him in his current situation. He should then wholly and completely make all the necessary preparations for that occurrence as if it is about to happen. He can then work proactively to stop whatever could occur from this tribulation, or remove what has already occurred from it or lessen it.
Source: Al-Wasāʾil al-Mufīdah li-al-Ḥayat al-Saʿīdah: 46-47
Translated by: Riyāḍ al-Kanadī