What would be a good way to set up farms and trade among planets to ensure that the people of each planet are well fed?
Firstly travel between planets needs to be cheap and fast enough to make it worth the effort of trading food. Ships need to be able to arrive in time to meet demand. There is no point turning up six months to two years after the famine. Unless travel is cheap and fast, planets have no choice but be self sufficient.
At best, food trade is likely to be preserved long life concentrates that can be made into food but take up the least amount of space for the most amount of meals. Plug the concentrates into a 3d printer and ten minutes later you have a piping hot steak and baked potato.
More than likely, trade will be in food producing equipment such as algae tanks, cricket farms and 3d food printers
Even on the relatively Earth like Mars, it will be very difficult for a long time. When exposed to water, Martian regolith releases perchlorate (bleach), making it very toxic. At some time in the past decade, scientists have grown potatoes in soil made from analog Martian regolith, but there is a long way from growing one potato plant to growing life supporting crops.
Each world would have to be evaluated first, and a treatment regimen for cultivating soil developed. Once you have a soil that is treated to where terrestrial plants can grow and produce edible foods, the process has to be expanded to cover several acres of land per person (yields will vary).
World's are large. Each world needs to be self sufficient for food. I can't see paying $10,000 per pound of potatoes, or even caviar.
If the planets had orbital rings which would allow for cheap transport between orbit and surface you solve one problem. You could use the rings to accelerate and launch cargo-pods or ships but they still need fuel to slow down/be captured by the receiver.
Fuel could be refined from moons or asteroids probably.
The thing is why? The travel times would be immense still. The amount of cargo shipped would still be low compared to what would be needed, especially compared to the size of population motivating an orbital ring.
And if you have that amount of industry/tech to build such structures you would be far better off building hydroponics and similar on site.
One situation that could motivate this would be a mother planet using its orbital ring to ship resources during colony setup but you would still focus on having the colony self sustained.
The economics just wont scale. You would probably figure out manufacturing/genetics in such a way that any planet would produce what's needed except special components and luxuries and even then it would still evolve fairly quickly to just needing the information to produce these.
You need a mechanism like the dune worm that produces something some special in such a difficult way to make it worth having that kind of trade.
Most in solar system trade would most likely be between space habitats/mining operations. Moving people, equipment and fuel.
So you either need to find a plausible way to make that expensive trade the only way combined with cheap transports to make it viable.