There are some plants that grow very well together and others that do not grow well together. Vegetable plants that grow well together are often called companion plants. Companion plants can provide mutual benefit to one another as they grow together. For example, tomatoes planted near basil, marigold or garlic benefit from the bug-repellent properties of these plants. But tomatoes should never be planted near potatoes, because the two plants share diseases between one another. When planting a garden, you should only plant vegetables near one another that complement each other.
Learn the specific qualities of each vegetable you are considering for your garden. For example, beans release nitrogen into the soil from their roots. Marigolds release chemicals in their roots that repel nematodes, which affect many crops such as tomatoes. You can find out about the beneficial qualities of plants from university master gardener programs, agricultural websites, gardening books or your county extension service.
Determine if vegetable plants have bad interactions with neighboring plants. For example, never plant corn and tomatoes together, because the tomato plant draws corn pests to the corn more easily. Additionally, plants such as potatoes should not be planted closely to gourd crops such as pumpkins or squash. Avoid planting bad companion combinations of crops together.
Select "trap crops" to plant near your desirable vegetables. Trap crops are crops designed to lure insects away from your vegetable crops. Select a cultivator of a plant that would be more desirable to insects than your main crop. For example, planting chervil in between rows of vegetables helps to draw slugs away from the vegetables. You can then hand-pick the slugs off of chervil and kill them.
Plant two crops with mutually beneficial properties together so that the plants can be of benefit to one another. This process is called intercropping. For example, you might plant runner beans between corn. The beans use the corn stalks as support, while the corn thrives on the nitrogen that the bean roots release into the soil.