A worm is a small, elongated, soft-bodied invertebrate that lives in soil or water. Worms play a vital role in ecosystems by aerating soil and breaking down organic matter.