I have had a miscarriage and understand how upsetting it is. I think the best you can do is remind yourself that it wasn't meant to be and there was obviously something wrong with the fetus. Remind yourself that you will certainly be able to have a beautiful healthy baby in the future. Try to keep yourself busy so you are not dwelling on it nonstop, but at the same time don't stop yourself from feeling the grief either, mourning the loss can help you come to terms with it. Take comfort in those around you that love you and care about you.
You have to know he/she in a better place!!! And there well always be another chance when you well have that beautiful boy/girl... maybe it wasn't your time! Stay postive at all times..... and try to stay happy