There are several ways to try and eliminate food desserts. I read a lot about them a few days ago and will share one link. First of all, I want to add that my little town in Georgia doesn't seem to have any of these issues.
Yes, small towns are very different than large, dense cities like NYC.
According to many articles I've read, the primary causes of food desserts is racism and poverty.
How would racism create food deserts? We must get away with this correlation == causation fallacy. Just because there may be more food deserts in predominately black neighborhoods does not mean that racism must be to blame.
Poverty I can see as a cause. Poor people have less disposable income, and may be more likely to eat fast food than cook at home. So there will be less demand for full-service grocery stores with large produce and meat/fish sections.
Crime also plays a role. If there is more loss due to shoplifting in certain neighborhoods, a grocery store will struggle to be profitable.
There is also a community garden in one part of town that includes some poverty stricken areas.
Community gardens are a great idea. In urban areas, they can be planted on flat rooftops.
But they should not be politicized. I recall AOC a few years ago lamenting that there was too much planting of "colonial" vegetables like broccoli instead of cassava that she would like to see more of. Never mind that cassava would not thrive in NY climate!
There are also programs like Meal on Wheels that help older adults have access to healthier foods. So, there are solutions other than government owned grocery stores. People just have to care about those who aren't as fortunate as themselves.
There are also commercial options for food and grocery delivery. NYC does have a great transit system, but carrying a lot of groceries is difficult on the bus or subway. So, getting groceries delivered is a great option for a dense city like NYC where many people don't drive.