Worms in stool means your child has worm infestation. Worm infestation is a common cause of weight loss
in children. You may the stool for examination for Ova/Parasite/cysts ( commonly termed as OPC) .
You may ask justification for such test as you already found the worm in stool, but you don't know the species of the worm (s) in your child. Different species have different types and duration of treatment.
So, visit a Pediatrician
/ General Practitioner immediately as worms are notorious for your child and may cause serious complications.
And one request, please do not rely on over the counter drugs. Your child may have causes of weight loss other than worms, so better to visit a doctor and get proper treatment.