Those worms are probably planaria worms. They dont harm fish. They come from too much uneaten food in the gravel. Clean you tank more. Baby fish can eat this worms, there is some kind of product to remove them and you could add some salt if your fish can take it. Stay calm dont worry.