Please ask for this test after miscarriage

Heather • so blessed to have my 2 beautiful children!
I miscarried in December last year at 6 weeks. I was very upset and devastated. Still, I'm determine to know y and how to prevent it next time. I know there's not always an answer and sometimes it just happens. Before I miscarried, I stopped birth control in July. Every cycle I would spot 3-5 days before my period. I thought that it was my body adjusting without those hormones but still wouldn't it happen less each cycle then? After I finally got pregnant I unfortunately at 6 weeks lost it. Why me? I'm healthy how could this happen? No problems at all with my last pregnancy 5 years ago.. So I saw my doctor who said these things happen. But no, in my gut I thought I want more answers and asked to get my hormones checked since my spotting before my period seemed abnormal. While, my progesterone was back a bit low but the culprit was my THYROID. I never had thryoid problem s. My levels were 4.6 and then 5.3. Not too too bad but to get pregnant it should be .1-2.5 or u can miscarry early (4-6weeks) pregnant because ur baby relies on your thryroid for brain development. If it's hypoactive already, u can miscarry or the baby can have more developmental problems. The good news, medicine will fix it and u can take it pregnant. So, please ask your doctor for a thyroid test. I wish I knew this because I wouldn't have had to have a broken heart and lost my baby. But I am happy I know so now I can hopefully have a healthy baby and pregnancy.