How to avoid miscarriages at any stage of pregnancy?

I had one very early (my first) and I'm so traumatized by it😭😭. Other than obvious no smoking alcohol or excess caffeine, what else can be done to guarantee the baby will make it through?

How to avoid miscarriages at any stage of pregnancy?
Post Opinion