grieving how to feel okay again.

I found out back in April that me and s/o were expecting our first together(I have 2 boys with my ex). He had been arrested 2 days prior to finding out on driving charges. I was bearly 5 weeks along at my first appointment so they wanted me to come back in a month for another ultrasound and to do the first ob appointment. It happened to be the day before my birthday and even tho my s/o was still in jail I was really excited. I had Just moved into our new place and was getting to see my lil bean again. I should have been 9 weeks along but when they did the ultrasound they said the baby's heart stopped at 7 weeks. A week later I lost my job. My s/o is still locked up and its been two months since losing the baby and I'm still not okay and I'm not sure how to be. I can't help but blame myself. I'm so depressed and alone I dont know what to do I have no one to talk to