looks like camallanus worms.
To get rid of these you can treat with Levamisole or some other treatments. I went with the straight Levamisole powder. There are instructions online you can find to use. It should also come with some dilution instructions. I did end up having to use more to get it to work in my case.
This happens, the worms hanging out, when the worms get to later stages. So you should be acting asap.
Generally the treatment is for a couple days at a time 2-3 times with 2-3 weeks between treatments, often they'll tell you to turn out the lights. I looked into this a lot and stumbled upon a research document, had nothing to do with fish treatments. They had Levamisole solutions and found that it dilutes due to light in about 9 days. So I stopped turning my lights out or covering the tank, I did turn mine down as I am able to. If you can't turn it down I would just not use the light and not worry about covering it. If you have plants you're worried... Honestly don't even sweat it.
There is a killing amount of like 13x the recommended amount. Maybe it's 5x? I don't recall, obviously. I believe I only felt it necessary to do 2 treatments on my tank, again I did a bit more than the recommended the second time and the second day on the the first treatment as it seemed to do nothing at the recommended amounts for 36 hours. If it's working you should notice pretty quick. But at recommended doses Levamisole doesn't kill it stuns so you MUST do gravel vacs or just vacs in generaly at the very least daily. You'll see the little bastards all curled looking like thinner snail poop.