Fleas, for example, would not be too hard to get rid of since they're external; however, how did pre-modern medicine people get rid of internal parasites such as intestinal worms? Did they just have to deal with them?
I can only answer this in concern to Ancient Egypt, as I have nowhere near enough knowledge of "pre-modern medicine" in general to answer this question in regard to other distinctive culture areas. And I don't know if that's really what you had in your mind when asking this question, but it's at least an example of how "pre-modern medicine" tackled such delicate problems as internal parasites.
That said - luckily for those suffering - the Ancient Egyptian didn't "just have to deal" with his unwanted lodger. There are numerous recipes for how to get rid of worms - and many of them are thought of as quite effective. The Papyrus Ebers, a huge collection of different recipes - meticulously and orderly put down -, is one of the peak moments of Egyptian medicine and includes a number of recipes against intestinal worms in its part about abdominal discomforts.
"To kill the worm (lit. "snake"): Root of the pomegranate: 1/64 Ipet (1 Ipet = 19 litres), water: 1/32 Ipet; to be exposed to the dew; to be squeezed; to be drunk over the course of one day" (Papyrus Ebers, 16,15-18 (EB 50))
"To kill the worm (lit. "snake"): Root of the pomegranate to be crushed in 1/64 Ipet beer. To be left outdoors over night in a vessel with 1/64+1/32 Ipet water. You should filter it through cloth the next morning. To be drunk by the man." (Papyrus Ebers, 19,19-19,22 (EB 63))
Renate Germer - both a Biologist and Egyptologist - has written about the effectiveness of such remedies, her verdict (in this particular case) was quite positive. The root (or the rind) of the pomegranate includes Pyridine-Alkaloid which is supposed to have a paralysing effect on the tape worm. This causes the worm to detach himself from the intestinal wall and forces him subsequently to take the "back door" out.
The use of the pomegranate as a medicinal remedy is singular in Ancient Egyptian art of healing, so we can attest that this was a "special" remedy against tape worms. EB 50 and EB 63 are the only ones to use the pomegranate, but most of the recipes between EB 50 and EB 85 seem to concern themselves with either tape or other intestinal worms. The Ancient Egyptian recipes differentiate between Hefat (HfA.t, "snake" - both EB 50 and EB 63 mention Hefat) and Pened (pnd, identification unsure, it's generally translated as "intestinal worm"). Many recipes against either worm include plants or minerals as remedies that we can't identify (yet), so it's very hard to judge their actual medicinal value. One example of this is "Wam" (wAm), which seems to have played a significant role against intestinal worms as a particular effective drug.
"Another (remedy): wAm(-fruits? -plants?): 1/64 Ipet, water: 1/64+1/64 Ipet. To be exposed to the dew over night. To be drunk over the course of four days - or with beer (instead of water (?))." (Papyrus Ebers, 18,16-18,20 (EB 60))
The nature of this recipe would indicate that it had (or was supposed to have) a similar effect to the ones with the root of the pomegranate in it - flush out the worm.
Of course magic played a huge part, too, in Ancient Egyptian medicine, although there are surprisingly few recipes in the Papyrus Ebers that include conjurations and spells and the like. EB 61 is an example of this.
"Another (remedy): common reed: 1/64 Ipet, Shames (SAms; identification unsure, maybe some form of Pyrethrum; Pyrethrums are a traditional source of insecticides): 1/4 Dja (1/64 Ipet = 1 Dja). To be cooked with honey. To be eaten. Their conjuration: 'The burden may be loosened! The weariness, which the-one-on-his-belly put in my belly, which is caused by (a) god, which is caused by an enemy, may yield! Strife be against him! The god may loosen what he has caused to be in my belly!'" (Papyrus Ebers, 18,21-19,10 (EB 61))
Many parasites are attested through examinations of mummies, skeletons and other human remains - amongst them tapeworms, round worms, threadworms and trichina. How these correspond to the Ancient Egyptian differentiation between Hefat and Pened is unsure. Bilharzia - caused by the larvae of the Schistosoma - is also attested in mummies. Bilharzia may be what Ancient Egyptians described as the "Aaa"-sickness (Aaa). There's no single description of the sickness itself, but the many recipes still preserved show that "Aaa" effected many internal body parts (especially heart and stomach) and caused general internal pain; bloody urine is also named as a symptom. Since Schistosoma are of microscopic size the Ancient Egyptians probably didn't know the Bilharzia's cause. Though at least one recipe seems to indicate the opposite.
"Another remedy, which is beneficial from those which are made for the belly: common reed: 1, Shames (see above): 1. To be smoothly grinded. To be cooked with honey. To be eaten by the man, who has worms (Hrr.wt, a general term to describe small crawling or creeping creatures) in his belly. It is the Aaa-sickness, which has created it. (It) doesn't die through any other remedy." (Papyrus Ebers, 19,11-19,19 (EB 62))
"Aaa" may be Bilharzia or not - in any case, the Ancient Egyptian wasn't left alone with his parasites. Their medicine knew of ways (and at least some of them proved to be quite effective) to get rid of them.