There are few better feelings than slicing up a homegrown tomato from your very own backyard—if you can get to your bounty before the bugs do. Keeping vegetable gardens naturally pest-free poses a particular challenge, as most people aren’t keen on ingesting pesticides along with their green bean plucked right off the stalk. One solution is companion planting, the age-old practice of situating non-combative, mutually beneficial plants near each other in the soil.

Cory Tanner, the director of Clemson University’s Horticulture Program Team, suggests leaning into trial and error when companion planting. “Experiment with different combinations and make notes of what works. Think beyond just the plants; soil health has a huge effect on crop success in the garden,” he says. But you can also take note of a few tried-and-true pairings below.

Guard cucumber plants with sunflowers.
Aphids and other leaf-footed insects are aggressive threats to cucumber plants, sucking the sap from their leaves and damaging the plant’s fruit and roots. Sunflowers are a “trap crop” that attract sap-suckers, making them an ideal companion when planted a short distance away to act as a lure. In keeping with the spirit of a vegetable garden, certain varieties of sunflower produce seeds that can be enjoyed roasted or raw and petals that make a cheery garnish for salads and cakes.

Avoid a slug fest with lettuce and mint.
Easily identified as the offending party by the shiny trails they leave all over your holey lettuce leaves, slugs are a major nuisance to leafy vegetables. While many gardeners find slug-elimination success with physical barriers, planting mint in a lettuce bed may do the trick. “The flowers of plants in the mint family are highly attractive to beneficial insects, so they attract predators of other pests when grown in the garden,” Tanner says. The aromatic mint family (which includes plants like sage and hyssop) can also deter pests with their fragrance, but beware—mint plants spread like wildfire, so you’d do well to divide them often.

Help carrots keep their cool with tomato plants.
While hot, sunny weather isn’t a pest per se, it can certainly become a scourge for garden crops in the South. Tomato plants are known for their ability to grow in the blink of an eye, exploding with abundant leaves, which can shade fragile carrot plants and simulate their ideal cool-season growing conditions. Carrots, in turn, aerate the soil and add back vital nitrogen, which is essential for consistent, lush tomato growth.

Protect the cabbage family with an army of herbs.
The cabbage family is large—broccoli, brussels sprouts, kale, kohlrabi, and cauliflower are all members—and often targeted by a fleet of hyper-specific bugs like the cabbageworm and cabbage moth. Interspersing your woody-stemmed veggies with a variety of herbs is a good line of defense: Catnip, mint, and rosemary will repel moths; tansy and thyme deter worms; dill and chamomile are said to improve growth and flavor.

Plant marigolds with…everything.
“Marigolds are one of the classic companion plants,” Tanner says. These cheery flowers are a vegetable garden’s workhorse, deterring a slew of common garden pests. “They’re known for being suppressant to nematodes, which are microscopic worms that damage plant roots in the soil,” he says. They’re also repellent to beetles and aphids thanks to chemicals released through their root system. Another bonus: Certain varieties (such as French marigolds and lemon marigolds) are edible.