UTIs while pregnant

Autumn
I'm currently 20 weeks and 3 days & have gotten 2 UTIs & possibly another one currently, I'm not understanding why this keeps happening but it's making me nervous bc my OB says they can cause miscarriage. Does anyone have advice on this topic or experienced this?