A miscarriage is a loss, a bereavement, a highly emotional and confusing experience. It would be good for you to consider contacting a support group where you could meet with others who have suffered this loss. Here is one, but if I don't know if they are local for you.
Babyloss Having support won't ease the pain, but it could help you to withstand it. Perhaps you can also in time also be prepared for a planned pregnancy.