Remove the rock. You'll never get it out with tongs or traps. Been there, tried that a million ways. They rarely leave their holes completely, thus making traps ineffective, retract lightning fast making manual capture challenging, and have the ability to regenerate their body parts, even their head, so if it breaks in half you're in no better shape.
The best I've managed is feeding flake food at night, using a red flashlight and tongs and grabbing one while it was snatching flake food.
Did I capture it? No, I did not. The worm turned around and started repeatedly striking my tongs which startled me, made me release pressure and lose the Eunice worm.
I've also tried removing their rocks (which had corals on them) and using heated water or soda water to "flush" them out. No luck, just angry corals. Ended up chucking theor rocks during a tank transfer and removing the corals
"Take out the rock" is the best advice I can give.