A worm is essentially a tube within a tube. The digestive system is a linear tube with an enlarged portion which can grind up leaves or other organic debris on which the worm feeds. The feces are called castings and serve to enrich the soil. This is just informational. Unless it is spring you probably won't be able to observe mating.
Worms are hamaphrodites, they are both male and female at one time.
Because any worm encountering another worm will immediately know that it can mate with the other worm. They don't have to spend much time determining whether the other worm is of the same or different sex. Worms mate in the spring. The genital openings are anterior to the clitellum, that band near the front end that is enlarged and of a slightly different color. The cocoon seals when it passes off the worm's head and fertilization takes place within the cocoon.