The recommended treatment for threadworms is mebendazole, a type of medicine used to treat parasitic worm infections. It works by preventing the worms from absorbing sugar (glucose), so the worms lose their energy and die within just a few days.