Breastfeeding can I stop??

So I’m 31 weeks pregnant and I plan on exclusively breastfeeding for at least a month after my baby’s born. I’d like to for a year but I know sometimes it gets hard and with me wanting to go back to my job I don’t think I’ll be able to but I wanna at least breastfeed for a month no matter what and I was wondering if after that month I decide breastfeeding isn’t for me can I just switch to formula or will that effect my baby. Like do u have to wean your baby off breast milk and onto formula or can u just switch?