Ttc after miscarriage

Hi everyone. I guess I’m looking for encouragement or virtual hugs. I am currently going through my first miscarriage after becoming pregnant for the first time. I’m trying to find comfort in the fact that I became pregnant without anything which is amazing considering I was diagnosed with pcos and endometriosis last year. I’m struggling with wondering why it happened even though I know it could have been a number of things. I don’t know what happens next and I don’t know what I could do to prepare my body as best as I can to have a successful pregnancy. Could anyone share their stories with me? I could really use it. Thank you.