Marigolds are most useful in repelling or warning away bugs when planted along with vegetables and fruits. This does not work on all bugs, and works best with non-hybridized, older varieties of marigolds, which have a stronger smell. The marigold family has several types; check hardiness and recommended soils before planting. Marigolds of most types work best on soil nematodes.
Marigolds originated in Central America. They are now inhabitants of much of Asia, Europe and the Americas; they have been used in perfumes, dyes, inks, paints, ornamental arrangements, in landscape design, and in religious ceremonies. Along the way, their insect-repellent properties were noted. These plants are sometimes confused with the European-origin calendula, also called marigold, and are even sold as calendula, but do not have the same properties.
Organic gardeners say that marigolds keep the soil free of plant-damaging nematodes, and discourage many insects in the garden. They may, however, attract spider mites and slugs. They also discourage whiteflies from attacking tomatoes when planted in a companion planting. Marigolds also deter beetles.
Many modern nursery strains of marigolds are de-scented, which will not deter bugs at all. Look for more old-fashioned varieties that are strongly scented. Note that some of the most effective bug-repelling types may have other unpleasant effects. French marigolds are great at repelling nematodes in particular, secreting a substance from their roots that keep them away. However, they shouldn't be planted near bean plants, as the beans will absorb the substance and bitter taste. Mexican marigold is the strongest-smelling marigold, and keeps away beetles and possibly even rabbits, but also has herbicidal properties toward some plants, including beans and cabbage.
Marigolds repel bugs best when planted in the ground near susceptible plants. Many gardeners add a marigold border to a vegetable garden, or ring their prize tomatoes with marigolds to keep off common vegetable and fruit pests. This is no guarantee, but they can help reduce bugs eating your food if you have the room to plant the strong-smelling marigolds. The closest thing to an insecticide wash you can obtain from marigolds is a bitter tea that, applied to lawns, patios or other plants, can help keep away crawling and flying bugs temporarily.
It can be tough to sort out the varying opinions on using marigolds as an insect repellent. Many garden professionals will tell you they don't work, while many home gardeners swear by them. Don't expect that planting marigolds gets rid of all the bugs in your garden, and realize there are some bugs, like mosquitoes, that marigolds will have no effect on at all. It is also unlikely that a treatment with marigold parts in it will actually kill any bugs; the best it will do is repel them from the applied area.