I've had worms a few times. When I was a kid and when I lived in the third world. I tried natural remedies like soaking raw garlic in water overnight and drinking it in the morning. (As much as I love garlic it's not an experience I'd recommend unless you are desperate
.) I tried hot chillies too and some other remedies but nothing truly worked except the medicine, which got rid of them pretty much immediately.
A friend said he got rid of his tapeworm by eating lots of hot chillies. Don't know if it's true but he seemed believable.
ASFAIK the garlic/chilly remedy works on the basis that a large amount of undigested stuff that the worms dislike will end up in your bowels and cause them to want to move home so they will be passed out when you go to the toilet (or they might crawl out of you
)
Worms are not something you want to have in your body; they are dangerous to your health and the health of others. Sometimes the symptoms, even from pin worms can be quite severe.
If you are living in conditions where worms are a major concern it might be best to have a survival kit that includes deworming pills. By all means try a natural remedy but don't do like I did and spend weeks refusing to take the "evil" medicine if it doesn't work. Mebendazole kills the worms and is the preferred medical treatment for anyone over 2 years old.