So prostitution is commonly called the oldest profession in the world. How did prostitutes avoid pregnancy in the days before cheap, reliable condoms and birth control? It would seem without some form of contraception that they wouldn't last very long as prostitutes.
One of the most popular methods would have been the vaginal douche, and there are references to this in the Old Testament. Women would have also used breastfeeding as a way to prevent pregnancy, and this practice dates back to Antiquity.
Other methods included uses of herbal remedies, such as teas and suppositories for prevention. Herbal abortives such as Raspberry Leaf would be used in the case trying to terminate a pregnancy.
Barrier methods have included early prototype condoms made from animal skin, and if rumour is to believed, lemon skins over the cervix (apparently favoured by Casanova himself!)