Allah the Glorified and Exalted says: “And remember Ayyub when he cried to his Lord: Verily distress has seized me, and You are the Most Merciful of all those who show mercy. So We answered his call, and We removed the distress that was on him, and We restored his family to him and the like thereof along with them, as a mercy from Ourselves and a reminder for all who worship Us.” [Source ‘Qur’an Surat Al-Anbiyaa’ 21 83-84]

Imaam ‘Abdur-Rahman as-Sa’dee  [Rahimahullaah] said: “Meaning, remember Our slave and Messenger Ayyub [‘Alayhis Salaam], praising him and revering him, and raising his station, when (Allah) tested him with a severe test and thus found him remaining patient, being pleased with Him. What occurred is that Shaytan had gained strength over his body as a trial and test from Allah. Shaytan blew into his body so he became full of ulcers. he remained this way for a long period, and his ailment worsened after which his family died and he lost his wealth. So he cried out to his Lord: “Verily, distress has seized me, and You are the Most Merciful of all those who show mercy.”

So he sought a means of nearness to Allah with supplication by mentioning his condition, and that affliction has seized him greatly. And due to the expansive and vast mercy of his Lord Allah answered him and said: “Strike the ground with your foot. This is a spring of water to wash in, cool and a refreshing drink.” [ Source ‘Qur`an Surat Saad 38:42]

So he struck the ground with his foot and a cold spring gushed forth, so he washed there from and drank, so Allah cured him of his ailments. Allah [Azza Wa Jall] said: “…and We restored his family to him…” This means We returned his family and his wealth to him.

Allah [Azza Wa Jall] said: “…and the like thereof…” Meaning that Allah bestowed upon him well-being, also an abundance of family and wealth. Allah [Azza Wa Jall] said: “…as a mercy from Ourselves…”. Meaning upon him due to him having patience and being pleased with what Allah had decreed, so Allah gave him an immediate reward before the reward of the Hereafter.

Allah [Azza Wa Jall] said: “…and a reminder for all who worship Us…”. This means We have made it an admonition for the worshipers who benefit from practicing patience. If they look at the distress that afflicted Ayyub [‘Alayhis Salaam].. how Allah [Azza Wa Jall] rewarded him after it left him, and if they look at the reason behind that, they will find that it was because of his patience. Due to this, Allah [Azza Wa Jall ]praised him because of it [his patience] in His statement: “Truly, We found him patient. How excellent a slave ! Verily he was ever oft returning in repentance (to us).” [Source ‘Qur`an Surat Saad 38:44]
So He made Ayyub [‘Alayhis Salaam] an example for the slaves when calamities befall them.”