For most people, treatment will involve taking a single dose of a medication called mebendazole to kill the worms. If necessary, another dose can be taken after 2 weeks. During treatment and for a few weeks afterwards, it's also important to follow strict hygiene measures to avoid spreading the threadworm eggs.