How to improve soil drainage
Improving soil structure is important, but you may also need to correct other problems if your garden is to thrive. Soil may drain poorly; it may be too acid or alkaline; it may suffer from chlorosis or excess salts, or be underlain by a cementlike layer of hardpan.
Poor drainage causes myriad problems. If water simply stands in the soil's pore spaces rather than draining away, there's not enough air available for roots and beneficial soil-dwelling microorganisms, and both may die. The reduced root structure can't adequately support the plant's leaves and stems, and the resulting stress makes the plant more susceptible to insect infestation or disease. Below ground, molds develop and the normal balance of fungi is disrupted--and the weakened root structure is more prone to invasion by water-mold fungi.
Fortunately, many drainage problems are easily solved once you become aware of them. First, know your soil texture: if the poor drainage is due to heavy clay soil, amend it thoroughly with organic matter. You may also want to mound the amended soil slightly, then grow plants on the mounds (this solution can be pleasing to the eye as well as beneficial to plants).
Many gardens drain poorly only in some spots. To pinpoint problem areas, inspect your garden after a heavy rain to see where water is standing. It may be sufficient simply to slope the soil in those areas so that water drains away from them. If that doesn't do the trick, you may need to dig a sloped trench and install drainage pipe perforated along the top and sides. Then refill the trench; when heavy rain comes, water should flow down through the soil into the pipe and be carried away.
If certain areas in your garden are always slightly boggy and don't lend themselves to structural change, your best tactic is to give in gracefully. Accept the situation and choose water-loving plants for those locations.