Firstly, select a site for your vegetable garden that offers good sunlight, protection from strong winds and good drainage. There are a number of strategies you may pursue here. Firstly, you can overcome compaction by cultivating the soil. This is most important in new gardens where building activity will undoubtedly have caused compaction. Rotavators can bounce over compacted soils so, if possible, compacted soils should be ripped to 400mm to break up the lower soils.
Compaction is a problem in clay soils.
In this case, add gypsum to the soil. Many organic materials can be added to soil to improve it. Green manure' is another option. This means growing a crop with the sole purpose of digging it straight back into the soil, to improve soil fertility and structure. Lupins or clovers are especially useful since they fix nitrogen into the soil as they grow.