You may sometimes read or hear about planting certain plants around other plants to prevent insect problems. This is called companion planting.
The idea is certain plants will give off aromas that will repel insects. Unfortunately, research doesn't substantiate claims around companion planting.
I've seen marigolds frequently recommended as companion plants for vegetables to prevent insect and nematode problems. This is a classic combination with tomatoes.
As far as repelling insects, again, there is no real benefit to this. In fact, marigolds have their own pest problems.