how big are the worms? can i have them when you get them out?
why do you want to get rid of them?
six line wrasse will eat them, arrow crab will eat them, coral banded shrimp will eat them....
as for the bottle, i have only seen it done for crabs and shrimp, as most of the worms can swim quite well, and can find the hole to get out...
need a bottle with a relatively long neck and small opening, cut the top of the bottle off at the shoulder( so to speak) invert the neck and opening into the body of the bottle an glue in place with crazy glue or silicone, allow to cure, add a piece of shrimp or some sort of fleshy food source,, sink bottle to bottom of tank and secure it on a bit of an angle, wait until morning remove your bottle full of crabs, shrimp, and worms, add back to the tank what you wish to keep..