How to get pregnant and not miscarry?

I know someone very dear to my heart who miscarried twice and is very hard for her to have a child. The first time she took shots to help her get pregnant, she miscarried. She did the IVF twice the first didn't work, the second worked and she got pregnant, but miscarried. What can she do to make sure she doesn't miscarry again? And should she try the IVF again? Please share experiences! Thank you ❤️