Imām Ibn Rajab (d. 795 AH) said:
The believer afflicted with a catastrophe may sometimes see its resolution as being slow, to where he loses hope even after frequent invocation accompanied by feelings of humility. Despite this, signs that his invocations are answered remain absent. This may then cause him to blame himself saying: This has all come because of you. If there was only some good in you, it would have been answered.
This blame is more beloved to Allāh than many forms of obedient acts. This is because it stipulates the servant of Allāh breaking down before his Master in admittance that he is truly deserving of the calamity that has befallen him; that he is undeserving of an answered invocation. It is at this point that his invocation is answered hastily, his affliction subverted. For the Most High is with the ones whose hearts are broken for His sake.
Wahb said: A man once worshipped Allāh for a long period until he experienced a need from Allāh. He then fasted seventy Saturdays, eating only eleven dates in each. Then, he asked Allāh to satisfy his need but was not granted it. He said to himself introspectively: This has happened because of you. If there was only some good in you, your need would have been granted. It was then that an angel descended upon him saying: O Child of Ādam! This one moment was better than all your preceding worship. Allāh has now chosen to satisfy your need.
Some of the early pious predecessors used to say:
It may be that the catastrophe before you shall cease. For the relief you have sought for an eternity has come. Relief from Allāh approaches, for Him there exists daily a matter [i.e. ceasing of a catastrophe] among His creation. If difficulty arises, then hope for ease. For He has ordained that ease always follows difficulty.
Source: Jāmiʿ al-ʿUlūm 2: 589
Translated by: Riyāḍ al-Kanadī