Breastfeeding advice.

So I just found out that I’m expecting baby #3🥰 I am 7 weeks today and I have a 1 year old son. I am currently breastfeeding him but I want to stop breastfeeding him because I am a high risk pregnancy. The problem I have is an incomplete cervix that is when a cervix isn’t strong enough to hold a pregnancy by it’s self so I have to get stitches in around 16 weeks. The thing is they told me that later on in pregnancy me breastfeeding can cause contractions and with the problem I have it may or may not be harmful. It’s a 50/50. They told me I could continue breastfeeding but I’m kind of scared to. Can anyone give me advice on what are things I could do to make my son stop breastfeeding. He hates formula so I am really really struggling. He won’t take the bottle no matter what. He will cry and cry for hours :( until I just give in on giving him the boob and I just don’t know what to do. Thank you.