After miscarriage when's it safe

Janice
I'm currently in the middle of a miscarriage. The baby stopped developing at 6 weeks and I just found out at 10 weeks. When is it safe to have sex again and to try again?