He (peace be upun him) used to say at times of calamity: "There is no god but Allah, the Great, the Forbearing. There is no god but Allah, Lord of the great Throne. There is no god but Allah, Lord of the seven heavens, Lord of the earth and Lord of the noble Throne.”
When something distressed him, he (peace be upun him) would say: "O Ever-Living, O Self-Sustaining, by Your mercy I call for help."
And he (peace be upun him) said: "The supplications of the distressed are: "O Allah, Your mercy I hope for, so do not entrust me to myself for even the wink of an eye, and amend for me all my affairs. There is no god but You." And when he was distressed he would pray.
He (peace be upun him) said: “No servant afflicted with anxiety or grief whereupon he says: 'O Allah, I am your bondservant, son of your bondsman and son of your bondswoman. My forelock is in Your hand; Your decision is being carried out in me; Your decree on me is just. I ask You by every name of Yours, which You have named Yourself or revealed in Your Book or taught to any of Your creations, or preferred to keep knowledge thereof to Yourself, to make the great Qur'an the spring [i.e., revival] of my heart, the light of my breast, and the withdrawal of my grief, and the departure of my anxiety and distress,' but that Allah will dispel his anxiety and distress and replace them with happiness.”
He (peace be upun him) would teach them when gripped with terror to say: "I seek refuge in the perfect words of Allah from His anger, from His punishment, from the evil of His servants and from the suggestions of devils. And I seek refuge in You, my Lord, from their presence."
And he (peace be upun him) said: “There is no servant afflicted with a calamity who says, 'Inna lillaahi wa inna ilayhi raaji`oon; Allaahumm-ajurnee fee museebatee wa-khliflee khayran minha' (We belong to Allah and to Him we will return. O Allah, reward me in my affliction and follow it up with something better for me) except that Allah will reward him in his affliction and follow it with something better for him.”