6 weeks pregnant with uti

Brittany
Went to the er last night and they told me I had an uti. They prescribed me Macrobid. Is it common to have a uti and is it safe to take Macrobid?