If you mean earthworms, their disappearance would seriously disrupt many ecosystems—but it wouldn’t end life on Earth. The biggest effects would unfold beneath our feet:
Soil would lose some of its natural maintenance. Worm burrows help air and water penetrate the ground. Without them, many soils would become less hospitable to roots and absorb rain less effectively.
Nutrient recycling would slow or change. Earthworms break down and mix dead plant material into soil, helping return nutrients to plants. Bacteria, fungi, and other decomposers would continue working, but wouldn’t necessarily replace everything worms do.
Growing plants and crops would become harder in many places. Losing those soil benefits could reduce productivity.
Animals that eat worms would lose a food source. Birds, amphibians, and small mammals would have to switch prey where possible, potentially increasing pressure on other animals.
If you mean every kind of worm, including microscopic soil worms and marine worms, the disruption would be much broader: you’d remove major links in both land and ocean food webs, affecting decomposition, nutrient recycling, and food supplies simultaneously.