So from what I understand brothels were pretty popular during medieval times and contraception didn't yet exist as we know it today. So the big question is how did prostitutes avoid getting pregnant?
Surely some medieval prostitutes, both those in brothels and those working on a temporary or contingency basis, did get pregnant. Court records from early 16C London, for example, might explicitly note that a woman initially sentenced to dunking in the Thames for whoredom was ultimately spared "being with child." It also seems to be the case that brothel keepers may have helped new mothers dispose of their children.
Nevertheless, medieval medical authorities held that prostitutes were infertile thanks to the extra dirt that built up in their wombs, which does suggest prostitutes developed rough methods of contraception. We know some women specialized in providing abortifacient herbs. In one 16th century German case, a former prostitute, even, was known to supply other women with herbs to, in the circumlocution of the court records, restore their monthly menstruation.
Ruth Mazo Karras, one of the most important scholars on prostitution in the Middle Ages, suggested one other option that subsequent scholars have generally agreed with. John Rykener is a rare case of a cross-dressing man charged with prostitution. In his own court testimony, he reported that none of his (male) customers had any idea he was actually male. That suggests that prostitutes had some sway with their clients in offering non-vaginal sex for sale.
Additionally, I need to mention one archaeological dig at Ashkelon in the Near East. This is a Roman bathhouse where the skeletons of many infants--born alive but dying shortly after birth--have been found in one of the drains. Archaeologists have posited that this bathhouse was the site of prostitution if not an outright brothel, and the dead infants were the victims of necessary infanticide. /u/kookingpot might be willing to say more about the dig and the various theories that have been proposed to explain the troubling evidence.
I've written a little about prostitution on AH before, if you're interested.
This question has been asked so many times we have a FAQ section for it: https://www.reddit.com/r/AskHistorians/wiki/health#wiki_contraception
Do we have any idea what sort of herbs (or combination of) they used as abortificants?
What led you to believe they didnt get pregnant?