Something I found, hope it helps.
"To get rid of these worms, you have to remove their food source. Start with a thorough gravel vacuum and partial water change (30%-50% change) or, if preferred, stir the gravel on a daily basis until all the excess food and waste runs through your mechanical filtration. This should be accompanied by weekly partial water changes until all your parameters are within an acceptable range. The worms themselves can be removed if you really want them gone fast or if you’re trying to breed fish (they will eat fish eggs), though left alone the fish will probably eat them and the remainder will die of starvation as their food source is systematically removed from the aquarium.
While regular checks of the water parameters will help you identify problems before they become serious issues, I strongly recommend having a secondary precaution in place. Water maintenance products such as EcoBio-Block will go a long way toward keeping the parameters healthy and preventing ammonia spikes. EcoBio-Block keeps high levels of beneficial bacteria in the aquarium for up to two years, which can readily deal with these spikes. This product also provides essential minerals that the fish need to be healthy, ensuring they’re in peak condition to deal with any issues in the aquarium."