When you suspect that you might have a nematode infestation plant roots will be were you will want to check and look for classic symptoms. Typical root symptoms indicating nematode attack are root knots or galls, root lesions, excessive root branching, injured root tips and stunted root systems. Thankfully, there natural products to kill them, such as Root Cleaner or you can try some home methods such as adding dehydrated shrimp shell meal to your garden. You will want to make sure though that it is a nematode infestation you are dealing with and not similar looking wire worms, which are often the cause of tunnels in onions, rutabagas, and other in-ground crops.
If you are aware that your area does tend to get nematodes and you are looking to prevent in the future there are some growing options you might want to incorporate into your garden practices.
Crop rotation to a non-host crop can be a useful tool to help manage root-knot nematodes. By alternating to a crop that the nematodes can neither feed on nor complete their life cycle on, this tool can promote a decline in root-knot nematode populations in the soil. However, effective use of non-host rotational crops for management of root-knot nematodes is dependent upon the species (and sometimes race) of root-knot nematode present in the field, or if the crop possesses any resistance genes. For example, M. hapla can reproduce on tomato cultivars without the Mi-1 gene, but cannot reproduce on corn and only poorly on cotton. Yet M. incognita race 3 reproduces very well on tomato, corn, and cotton. When considering crop rotation, it is useful to also consider whether any cover crops that are used may be a host to root-knot nematodes.
Source: NC State Extension, Root-Knot Nematode of Tomato
Marigolds can be grown ahead of time as a cover crop to suppress nematodes before planting a susceptible crop such as a vegetable crop. It also is a good choice to plant in ornamental planting beds where root-knot nematodes are a problem on other annuals. In order to be an effective cover crop in nematode management, marigold should be planted at least two months before the desired vegetable crop. Furthermore, it must be planted at the same site in which the vegetable crop will be planted (see “Considerations” section below) otherwise no benefits can be gained from marigold root exudates. Marigolds can be disked or hoed into the soil in the fashion of a green manure to prepare the field for planting of the actual crop.
Source: UF: IFAS Extension, MARIGOLDS (TAGETES SPP.) FOR NEMATODE MANAGEMENT