Mulches such as grass clippings or leaves will provide a food source. Mulches also will help moderate soil temperatures in the summer, making the upper layers of the soil more desirable for worms. Worms, as well as plants, do best with moderate levels of soil moisture. Too much or too little moisture is bad for both worms and your plants. Reduce your use of pesticides.
Fungicides are especially toxic to many worm species.
Use fertilizer carefully. Not only can excessive use of fertilizer contaminate water, but also some studies have shown that excessive nitrogen fertilizers may harm populations of certain worm species. Reduce tillage in your garden. Numerous studies have shown that earthworms are disturbed by tillage. Too much tillage reduces organic matter needed as a food source and can decrease soil moisture.