Planting marigolds near tomatoes can keep away some of the pests that can harm your tomato crop. Marigolds planted near tomatoes repel whiteflies. Marigolds also combat nematodes in the soil. This benefits tomato plants, but also indirectly benefits other vegetable plants if you have a nematode problem.
Not all marigolds are created equal. GH Organics recommends planting the French marigold (Tagetes patula) for its beneficial effects. Calendula (Calendula officinalis), or pot marigold, also deters garden pests, including the tomato worm.
While tomatoes and marigolds do have a beneficial relationship, there are other plants that help tomatoes. These include basil, borage, chives and mint. Additionally, not all "companion planting" relationships work in real life. While there is scientific evidence that marigolds do help tomatoes, as Cornell University notes, other relationships (such as carrots and tomatoes) are bad science. When considering other types of companion planting, do research to tell fact from folklore.