Help please

Andrea

I’m 24 weeks pregnant and I was put on bed rest due to a urinary infection that got to my right kidney but I’ve also been having contractions and some mucus comes out of my vagina occasionally ; my doctor said that I’m at risk of having an early birth and I haven’t been feeling any better even with the medication and bed rest my contractions keep coming and are painful sometimes I have a big pressure on my pelvis my baby is in position to come out and I’m worried and scared I just don’t know what to do