Wikipedia's definition:-
Companion planting in gardening and agriculture is the planting of different crops in proximity for pest control, pollination, providing habitat for beneficial creatures, maximizing use of space, and to otherwise increase crop productivity. Companion planting is a form of polyculture.
I have a flower bed in my veg plot to attract the pollinators but the most crucial item to me is 'Maximizing use of space'.
Plant lettuce amongst Tomatoes, Carrots, most root crops because you will be harvesting the Lettuce way before the other crops mature.
I grow Cucumbers alongside my Grape Vine and they quite happily intertwine.
I have a Plumeria in a large pot and I sow a few Pole Beans around the edge of the pot and they use the Plumeria to climb.
Most plants will happily co-exist so don't be afraid to experiment.
Happy Gardening👍