Well-drained rich soil is a prerequisite for lush lawns, thriving flower beds and productive vegetable gardens. Running water erodes soil and causes damage. Soil that drains too fast deprives plants of nutrients and moisture. Soil that doesn't drain well drowns plants. Standing water becomes a breeding ground for mosquitoes.
The simplest drain is a ditch to channel the water from the garden and direct it to an area where it can run off, or be used for watering. The ditch must be going down hill at all times or the water will overflow and puddle where the ditch becomes level. Gravity works to pull the water from the top of the hill or trench down. Fill the ditch with river rock to stop the water flow from eroding the soil within the ditch.
A French drain is a pipe that has a series of holes on opposite sides of the pipe. Most of the time the pipe is made of PVC, polyvinyl chloride. The drain lengths have a slightly narrower opening on one end. The narrower opening fits into the wider opening of the next length of pipe. The drain is then covered with a porous fabric which keeps dirt and muck out of the drainage holes. The pipe is buried from 1 to 6 inches under ground with the holes to the sides--not above and below. Water seeps into the pipe through the holes and is channeled away. The pipes must be going downhill or the trench for the pipe must be dug slightly deeper as it goes along.
Amend the Soil
Combine clay soil with organic material, sand and gypsum. The exact amounts depend on how much the clay holds together and prohibits the absorption of water. Test different ratios until you find one that loosens up the clay. One to try would be 1 cup of gypsum, 2 inches of sand and 2 inches of organic material, and mix it well.
Amend sandy soil, which drains too fast, by adding organic material and top soil. Top soil is different than potting soil, so check the label of the bag. Exact amounts depend on your soil. Start with a 2-inch layer of both the organic material and top soil. Well rotted manure works as well.
Avoid poor drainage by installing raised beds and filling them with top soil. The beds don't have to be tall, 12 to 18 inches should be high enough. Use stacked bricks, cement blocks or wood. If you choose wood, recognize that it won't last more than a few seasons.