Pick a plant to see what it grows well beside and what to keep it away from. Pairings are the classic, widely-published ones, a mix of tradition and trial, so treat them as guidance for arranging your beds.
About this tool: does companion planting actually work?Companion planting mixes evidenced ecology with folklore on the same chart, and published charts contradict each other. Pairings with a stated mechanism are the ones with support behind them.
The reliable version is diversity plus rotation: mix families within a bed, keep something in flower, and move each family on a three or four year cycle. Bad neighbours are usually just competition or a shared pest. Marigolds and legume nitrogen are both weaker than their reputation.