Knowledge is key and investment in education is essential (“advertising” is “education”).
U.S. tax dollars have paid for food databases that allow us to calculate the nutritional value of foods. See, for example, https://docs.google.com/spreadsheets/d/1crP1tpb7hCJXW_k53fV2YljaBTTYbEE-zHU5lQ39umM/edit?usp=sharing (disclaimer: to understand what is going on you need to know something about spreadsheets). So it is possible to consciously create a “food consumption” plan that meets nutritional requirements with food costs in mind.
As a home gardener, there is definitely a learning curve regarding climate, pests, and soil quality. But you can start small learning how to grow plants with window gardens in containers, and go from there.