The worm is red from the fish's blood. It's a parasite that attaches to the intestinal wall. Not too many fish survive this parasite. Treating it is difficult. If the worm dies inside the fish, the fish will die as well, at least in most cases. Try adding some kind of garlic extract to the food, assuming it's still eating.
David