The first defense to a pest free garden is quality soil. I never get tired of saying the word compost. Cultivating compost into you soil before planting not only makes it healthier but deters some pests from destroying the foliage. Compost contains benefical insects as well as micororganisms that insects aren't crazy about. Moisture control is also important in insect control. Many of those critters eating your vegetation prefer damp surroundings. Weeds attract insects, so be sure you remove them as often as possible.
The sign of an infestation in your garden is partially eaten leaves. Take control at the first occurrence of harm. Some critters may not be visibly evident making them difficult to identify. Fill any spray bottle with non diluted vinegar and spray the plant. Vinegar contains a mild acid that is effective against many insects both in the garden and around the house. Even several bugs that are not eliminated by an application of pure vinegar are deterred by the odor.
Young seedlings can be the most vulnerable to critter damage. Protect the growth by creating a shield. If you hold on to your milk jugs cut the top and bottom off and place around the plant. If you do not have a milk jug use any juice container you may have. Save water bottles and they will serve the purpose very well. I would stay away from anything metal. Once they begin to rust the chemicals they release could attract more pests.
A mixture of dish soap and cayenne pepper will also keep your garden safe. Soap is an alkaline and will not harm your produce. The anti fungal properties will remove the outer protective coating of the insect. When you add a few drops of oil or pepper to the soap you create a suffocating element that clogs the insects respritority system. You will only need about two tablespoons of dish soap for one 32 oz spray bottle. Although this combination is not effective on all intruders it does work on a very large portion.
For a quick and easy way to get rid of flying pest all you need is sturdy paper and honey or syrup. Cut a 12 inch strip of paper about six inches wide. Orange or bright yellow paper naturally attracts flying insects, so it would be your best option. Coat both sides of the paper with honey or syrup and hang the strip in the garden. This technique will also work on your patio or front porch to trap ordinary house flies. If common fruit flies are a problem hang a couple in the kitchen.