This is why compost must be mature before it is used. Rotate crops to avoid refueling the same disease year after year. Companion planting pungent herbs like garlic and mint with tomatoes or other susceptible plants will discourage garden pests that are attracted by smell. Marigolds are old standby companion plants that attract hoverflies, which feed on aphids. Finally, some animals we brand as pests are actually friends of the garden.
Snakes eat mice, and birds eat many insects.
Skunks and raccoons eat certain ground-dwelling pests, and spiders trap insects in their webs. Ants may bother your plants' roots when they make nests, but they benefit the garden by preying on other insects.