If you have worms, you will have in most cases barely burden. If you want to detect them, you should regularly check your stool.
You prevent contamination through good hygiene. Wash fruits and vegetables well, let meat be well done.

Herbs against worms

Wormwood (Artemisia absinthium): 8 g wormwood tops in a liter of boiling water, drink it as a tea.
Tansy is literally a herb against (tape) worms and parasites: take 30 grams of dried herb in 500 ml of boiled water. Drink a cup in the evening and morning on an empty stomach.

Of tansy leaves are traditionally done in pancakes in the city of Diest (be).

According to Living in 1870, excerpts from the then 'Winkeler Prins' (encyclopedia):

To dispel the tapeworm, various means are recommended, but none of these are infallible. One of the best .. (finely ground) rhizome of male fern (aspydium filix mas), already prescribed by Galen and Dioscorides. .. or bark from the roots of the garnet tree. (also kousso or the flowers of an Abyssinian plant (brayera anthelmintica) ... as well as kamala or the powder of the glands of an Indian plant (Rottlera tinctoria) ... under the direction of a doctor!

The (fox) tapeworm (Echinococcus multilocularis) is a parasite that keeps alive and multiplies at the expense of its host. This may also be a cat, rat, mouse or dog. The eggs cannot be seen with the naked eye. They can be on berries, to a height of 1 meter. Wash and boil (+60⁰C) so food that you find. Wash your hands thoroughly after each contact with earth. Make around your vegetable garden a good fence where foxes cannot get trough or over. Shower hounds after hunting. Deworm dogs every 4 weeks. The larva affects your liver. Alveolar echinococcosis is in most cases fatal.

More information about various types of worms

lintwormI have repeatedly heard and read the story that you can remove tapeworm by fasting a few days and then hang with open mouth over a bowl of warm milk (or even coffee,..). The tapeworm, searching for food, comes out by itself. Pull it all the way out, so that not one piece will stay. What would become a new one again. I cannot find confirmation anywhere from a reliable source.

"Every worm has its people." (John G. Elburg)