Companion planting is good, but plants will do better if they are not crowded. One concept of companion planting is to plant something that will mature quickly next to something that is longer season. Like radishes next to squash.
The companionship of tomatoes to basil is best in the kitchen. Basil has long been known as the tomato herb. For a companion planting use parsley with tomatoes.
Aromatic herbs such as tomatoes, sage, and rosemary are said to repel the cabbage moth, so plant cabbage near tomatoes. Bear in mind that both of these plants are heavy feeders and get quite large. For best production, do not crowd them. It is enough that the companion be nearby.
Onions are said to do well planted close to beans. Cucumbers and potatoes near Corn. Beets with kohlrabi or onions.
Marigolds are said to repel some insects. Scatter some all over the garden, or make a row around the edges. I like to take a flat of marigolds and when I am planting seed in the garden, mark the rows with a marigold on each end.
Non compatible plants are sunflowers next to any broad leaved plants. Pole beans with beets or kohlrabi, tomatoes with fennel or kohlrabi.
Gardening at 5000 feet elevation, zone 4/5 Northern Utah, Frost free from May 25 to September 8 +/-