Hazrat Mufti Ebrahim Salejee (Daamat Barakaatuhu) mentioned:
Shaikh Abdul Qaadir Jeelaani (rahmatullahi ‘alaih) explains that calamities are either a means of punishment or a source of blessings. It all depends on a person’s response and attitude to that calamity. If he is calm, composed and does not adopt a complaining attitude then the calamity becomes a blessing in disguise. Through this calamity a person’s status becomes elevated and he becomes closer to Allah Ta‘ala. On the contrary if he becomes distressed and asks questions such as “why did this happen to me” etc. and adopts a complaining attitude then this calamity becomes a punishment for him.
When any calamity strikes then the right thing to do is to fall into sajdah before Allah Ta‘ala and beg His forgiveness for any misdeed we may have committed.
Sometimes the reason for these questions and complaining attitude is our association and interaction with the West. Their culture is designed in this way. When we go through their training systems and channels, like schools, universities etc. then their ways begin to take root in us. A believer always has his focus to Allah Ta‘ala and assigns his affairs to Him.
Many a times the difficulty that a person goes through becomes a barrier between him and sin. But no sooner the difficulty is removed and he has excess wealth and free time, he falls into sin.