There are two basic types of marine worms: flatworms (Phylum Platyhelminthes) and those with segmented bodies (Phylum Annelida).
Flatworms are basically crawling digestive tracts. They have no body cavities and no internal circulatory or respiratory organs. They rely upon diffusion to distribute oxygen and nutrients into their bodies. They represent the most primitive animals having bilateral symmetry, versus radial symmetry like sponges and corals. About 4,000 of the 20,000 species of flatworms live in water.
The annelids have segmented bodies like a set of conjoined rings. Besides digestive tracts, they have internal circulatory systems. Most have hairs (setae) that project from the surface of each segment. Those assist in locomotion and also in defense. For example, the setae of one group of bristle worms called fireworms secrete a strong toxin that is very painful to humans. Other bristle worms live more stationary lives in holes or tubes. Those generally feed by filtering the water, using feathery cilia to trap food particles and carry them into the mouth. The bobbit worm is much more aggressive. This nocturnal hunter pokes its head out of the seabed, then uses its wicked jaws to grab prey that approaches too closely. About 9,000 of the 22,000 species live in water.