Earthworms do more than most of us realize to improve soil. As they tunnel through the soil, they bring virgin, nutritious soil from below the surface. And their castings are actually a nutrient-rich fertilizer, containing nitrogen, potassium, phosphorus and many other micro nutrients essential to healthy plant growth. But not all earthworms can be added to garden soil. Purchase an endogenic variety of earthworm like Lumbricus terrestris. Other types, like those used for vermicomposting are unlikely to survive for long.
Fertilize the soil. If earthworms are not present in your soil, it's likely the soil is too poor to support them. Till the soil to a depth of 6 inches with a pitchfork or hand tiller. Then spread 3 inches of compost over the soil and dig it in to a depth of 8 inches. Tilled, enriched soil can support up to 25 earthworms per cubic foot. Once your soil is fertilized, the earthworms will probably find your garden on their own.
Spread purchased earthworms over the surface of the soil. Space them out so that there are only two or three per every square foot of soil.
Spread a 1-inch layer of organic mulch (dried leaves are ideal) over the soil. It will keep the soil cool and moist and provide the worms with food.