Asalaamu Alaikum,
To Allah we belong, and to Him is our return.
The loss of a child is truly a test of patience for all affected. Any tragedy which befalls a believer is a sign of God strengthening that person in faith and patience. One who exhibits patience will be compensated for their trial in the Hereafter, God willing. The following are sayings of the Prophet Muhammad (pbuh) regarding the loss of a child:
In al-Tirmidhi, Ahmad, and others: "Whoever of my Community have two forerunners [farataan=children who died early], Allah enters them Paradise." `A'isha said, Allah be well-pleased with her, "What about a single forerunner?" The Prophet replied, "And whoever has a single forerunner, you gifted woman!" She said, "And whoever has none?" He replied, "I am the forerunner of my Community. They endure nothing greater than my loss."
In Ahmad, al-Tirmidhi, and Ibn Majah, the Prophet said: "Whoever sends forth three children that never reached puberty, they will be for him [and her] a strong fortress [in the hereafter]." Abu Dharr said, "I sent forth two." The Prophet said, "And two." Ubay ibn Ka`b said, "I sent forth one." The Prophet said, "And one; but that is only [subject to SABR] at the first shock." From Ibn Mas`ud.
In the Musnad of `Abd ibn Humayd from Mu`adh, the Prophet said: "No two Muslims lost three children except Allah will cause the two parents to enter Paradise through the favor of His mercy toward them." They said, "What about two, Messenger of Allah?" He said, "Two also." They said, "And one?" He said, "[Even] the miscarried child will certainly drag its mother [and father, see below] with its umbilical cord to Paradise!"
The Prophet said, "The miscarried child will pester its glorious and mighty Lord for His entering its two parents into the Fire until it is told, 'O miscarried child that pesters its Lord! Enter your father and mother into Paradise.' Then it will drag them with its umbilical cord until it makes them enter Paradise." Ibn Majah and Abu Ya`la from `Ali.
And again, "By the One in Whose hand is my soul, truly the miscarried child will certainly drag its mother with its umbilical cord to Paradise, provided one expects recompense [for SABR]." Ibn Majah and Ahmad from Mu`adh.
And he said: "Your little ones are the larvas (da`aamees) of Paradise. They will meet their parents and grab them by their garments or their hands to no end other than that Allah will enter them Paradise." Sahih Muslim.
"I swear that a miscarried child of mine I send forth before me is more beloved to me than [raising] a mounted knight that survives me." Ibn Majah from Abu Hurayra.
Wasalaamu Alaikum