The best way to prevent worms is to clean up the poop often.How many day do I need to put garlic in the water? Do I dump the unranked water out every day and replace it with fresh garlic water.
In any case, if you suspect worms....I think a float test is in order to find out if there are worms, and if so, which ones. Then treat.