Among the most beneficial things that remove worries and anxieties when a calamity befalls a person, is for him to struggle to lighten its difficulties by imagining the worst possible thing that would have happened to him, and to try to put up with it. Then let him physically strive as much as possible to lighten the difficulty. By his striving for what will benefit him, and by his effort in putting up with it, his worries and anxieties will vanish, and he will have used his energy in achieving what is beneficial and warding off what is harmful, within normal human ability.
So if dreadful things, or illness, or poverty and deprivation of wants afflict him, he should encounter that with difficulty and try as much as possible to put up with it. In fact, he should prepare himself to put up with something worse. This is because preparing oneself mentally to deal with unpleasant things makes them light, and blunts the pangs of their pain. This is especially so, when in addition to that he physically acts to ward them off. By that he joins together the dual acts of mentally preparing himself to deal with the calamity, and the physical effort to ward off the worries, which together serve to engross him away from being troubled and disturbed by the calamity. He should also make an earnest effort to replenish his inner energy necessary for encountering these adversities.
In addition to all these, he must absolutely depend on Allah in all circumstances, and have sincere trust in Him. There is no doubt that these things are very helpful in bringing about happiness and satisfaction to the heart, and besides that, there is what we hope to gain of reward in both this life and the next. This is well know from experience, and whoever tastes it knows it.
Useful Ways of Leading a Happy Life by Shaykh Abdur Rahman bin Nasr As S’adi Pages 26-27