One way to keep insects out of your garden is by growing herbs. Herbs encourage the good bugs to come and the strong smell helps repel the pests. An example is basil which normally accompanies tomatoes, helping to attract bees which help pollinate tomatoes. Basil also repels whitefly and experts say it can make tomatoes smell better and larger.
Aphids are another pest that can be naturally repelled by growing phacelia. This plant will attract hoverflies and bees, and control aphids.
Dill is also useful—its flowers lure beneficial insects, and its foliage helps spice up your dishes.
Borage is a self-breeding herb that produces blue flowers which bees find attractive. More bees in your garden translates to improved crop pollination.
On the other hand, marigolds can deter white flies. Try planting marigolds near tomatoes to prevent them from invading your garden. Marigolds also encourage hoverflies, a beneficial insect which helps pollinate your crops.