That strange creature appears to be a hammerhead flatworm, also called a land planarian. Its most recognizable feature is the widened, shovel- or hammer-shaped head that makes it look as though a normal worm has something stuck to its front. These flatworms prefer moist environments and are often spotted on sidewalks, patios, gardens, and driveways after rain or during cool, damp mornings.
Hammerhead worms are predators rather than ordinary soil worms. Several species hunt earthworms, slugs, snails, and other small invertebrates, covering their prey with mucus before feeding. Some hammerhead species found outside their native range originated in Asia and were accidentally transported around the world through soil and potted plants. Because earthworms play an important role in soil ecosystems, invasive hammerhead worms can be concerning when they become established in new areas.