Coffee grounds can help attract earthworms to the garden. You can place coffee grounds in your compost pile/bin or you can lay used coffee grounds on the top of the soil. If you place coffee grounds directly on your garden, make sure they are used coffee grounds and don't put more than an inch high. Too many coffee grounds can be harmful.