So We responded to him and removed what afflicted him of adversity. And We gave him [back] his family and the like thereof with them as mercy from Us and a reminder for the worshippers [of Allāh].
The Prophet Ayyub Allah tells us about Ayyub (Job), and the trials that struck him, affecting his wealth, children and physical health.
He had plenty of livestock, cattle and crops, many children and beautiful houses, and he was tested in these things, losing every thing he had. Then he was tested with regard to his body, and he was left alone on the edge of the city and there was no one who treated him with compassion apart from his wife, who took care of him. It was said that it reached the stage where she was in need, so she started to serve people (to earn money) for his sake. The Prophet said:
The story of Sayyidna Ayyub (علیہ السلام) is based mostly on Jewish legends. Those which are considered as historically reliable by scholars of hadith are being reproduced here. The Holy Qur'an tells us only that he suffered from some serious disease but he endured his suffering with fortitude. Ultimately he prayed to Allah for recovery which was granted. During his illness all his family members and friends disappeared. They either died or just abandoned him to his fate. Then Allah Ta` ala restored him to complete health and gave him back all his children and also an equal number in addition. The remaining elements of this story have come down to us either through authentic sayings or by way of historical accounts. Hafiz Ibn Kathir has recorded the story as follows:
God provides examples differing in kind and of the highest order through His prophets, the purpose being to give people a set of ideals. One of these examples is that of the Prophet Job (Ayyub). Job was an Israelite prophet probably some time in the ninth century B.C. According to the Bible, he was initially very rich. He was blessed with farms, cattle, houses, children, etc., to such an extent that it was said that nobody was his peer in the entire east. In spite of this, however, Job was a very grateful and faithful person. His life set an example of how a person may remain humble and modest, in spite of being blessed with great wealth and honour. But, Satan reversed the lesson to be learned from this situation. He managed to convince people that Job’s extraordinary reverence for God was on account of the extraordinary blessings that had been showered on him. If he were to be deprived of these blessings,—so Satan maintained—his entire gratefulness would vanish. God thereupon set another example through him. Job’s cattle died, his farms were destroyed, his children died and even his body was afflicted with a disease. All his friends and relatives left him, except his wife who remained with him. But Job reconciled himself with God’s decision. He exercised the utmost patience. In the words of the Bible: ‘Then Job, tore his robe and shaved his head; and he fell to the ground and worshipped. And he said:Naked I came from my mother’s womb, and naked shall I return there. The Lord gave and the Lord has taken away; blessed be the name of the Lord. In all this Job did not sin, nor did he charge God with wrongdoing.’ (Job, 1:20-22). When Job showed so much patience and gratefulness, not only was a befitting reward set apart for him in the Hereafter, but his circumstances in the world were also changed. ‘Then God gave him double of what he had before.’ (Job:42:12). This very incident is thus figuratively described in the Prophet Muhammad’s saying: ‘When God changed the days of Job again, He sent a shower of golden grass-hoppers on him.’
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.