Need advice

Found out today I had complete miscarriage. I am so upset and trying to cope. It's killing me to think about if I could have done something different. How can I move past this. My dh is so upset as well. Please give me any advice if u have previously miscarried about how you were able to cope with it.