I've found that when the Lord brings you through a trial He will teach you things, if you are willing to learn. I share these with you in hopes that it may help another hurting soul and draw you closer to our Father God.
1) In times of great heartbreak and trial, pour your heart out to the Lord. Tell Him your sorrows and your griefs. He tells us in His word that He is familiar with suffering.
He is despised and rejected of men; a man of sorrows, and acquainted with grief: and we hid as it were our faces from him; he was despised, and we esteemed him not.
Our Lord can relate. Christ suffered greatly on our behalf. He has a compassionate heart to those who are going through hardship.
2) Turn to the scriptures for your comfort and guide. The Psalms are replete with passages exhorting us to trust in the Lord. For this particular trial Job 1:21 helped me to face it.
And said, Naked came I out of my mother's womb, and naked shall I return thither: the LORD gave, and the LORD hath taken away; blessed be the name of the LORD.
3) Realize that all of our children belong to the Lord. He has only entrusted us as stewards to care for them here on Earth. If He takes them home, then He is within His right to do so.
4) Use this as an occasion to draw near to your spouse. I am a husband. So I mainly speak through that perspective. When the miscarriage is going on I feel so helpless. I've found that often the best thing I can do is to pray for my wife, hold her, and comfort her.
5) Love your other children. If you don't have other children, then this may not apply to you, but in my case the Lord has blessed us with seven beautiful children. Hold them close. Praise the Lord that He gave you the ones that you do have. Give them grace as they grieve in their own way.
6) Finally, appreciate the church universal. I received a great outpouring of support from Christians around the world. Technology has brought us together. The Lord has provided the bond.