How do you treat tape worm in humans?

Ew that's sick. But you go to the doctors, and tell them you have a tape worm. They will give you medicine and then it also may come out when you go to the bathroom. But the only way to completely get rid of it is by going to the doctors.