Traditionally people would use spices and herbs known to kill worms. A lot of this traditional knowledge was lost during the Baby Boomer era.
Picrel: a roast ham embedded with cloves, a spice known to kill pork tapeworms.