One way is to combine plants that can benefit from each other's different sizes. For example, large plants can give shade to sun-sensitive ground plants, or a sturdy plant with sparse branches can be used to support a climber in smaller spaces. Plants with deep-growing roots are always good neighbors for plants with short roots, as they won't get in each other's way. Or you can combine plants for an attack and defence system, either repelling the fungi that a neighbour is sensitive to, or promoting the fertilisation of other plants.
Herbs as a defence system
When we plant different herbs together in a single pot, we create handy herb garden for our balcony or kitchen windowsill. This technique aso has the added benefit of keeping the surrounding plants happy. For example, sage helps to keep at bay the bugs that target rosemary, and chives work twice as hard, keeping fungi away from roses and aphids from tomatoes. Basil protects tomatoes too, a perfect growing combination if you're planning a caprese salad, and another perfect pairing for keeping the bugs off is borage and strawberry. Lavender attracts bees and butterflies for its scent and flowers, but it also deters hungry insects that could eat your young fruits and vegetables. Make it a focus of your kitchen garden, and plan your plants around it.
Mix and match plants, vegetables and herbs
It's a nice idea to companion plant for visual effect. Combine a mix of plants, vegetables and herbs in the same large pot, alternating high with low, green with colour, and fragrant with neutral. We filled a container with vine tomatoes, pansies, anise hyssop, black chokeberry and snapdragon. You can see what that looks like below, in the far left tub. Experiment and be guided by your intuition, it's what makes gardening so enjoyable.