Understand how and why insects are attracted to plants
Insects usually search for their host plant by odor or color. Planting a variety of species in your garden makes it more difficult for insects to find their favorite plant. For example, onions and carrots confuses the cabbage moth when it is seeking out broccoli, cabbage, and kale.
Strong-smelling herbs like rosemary, sage, lavender, and oregano are especially good at masking plant odors. Planting the perimeter of a garden with plants with strong odors may prevent infestations.
Other plants that repel include marigolds, geraniums, petunias, nasturtiums, southernwood, parsley, catnip, and members of the onion family.
Four-legged pests may be deterred from entering a garden by placing sticky (tomatoes) or scratchy (squash) plants around the perimeter to create a physical barrier.