Do you think that there is enough inventory and stock to go around? Would those alternatives replenish their inventory in a timely fashion? Would you seek alternatives to your normal shopping?
I think people vastly overestimate the capabilities of their local options.
Neither Amazon nor Walmart produce those commodities, they distribute them. Sure, there would be some initial issues, but both the remaining distributors as well as the producers would have strong incentives to quickly resolve those issues.
Companies like Amazon and Walmart massively distort the market, and do so quite deliberately. It's hopelessly naïve to think that if they vanished tomorrow, everyone would be able to just shrug and switch their purchasing to a drop-in replacement.
That's only possible in, as someone else described it, the "spherical cow in a vacuum" type of hypothetical free market. We live in the real world, where an arbitrary number of fully equivalent businesses can't actually continue to compete perfectly for everyone's money.
An enormous amount of people in America would be utterly screwed if it went away.
Also, the overwhelming majority of people are driving to Walmart so even if significantly less convenient they can also drive somewhere else.
Although the only thing I wish they cut back on was their employee culture cult stuff. It reminds me of McDonalds where you have to say thank you to a supervisor after everything, even if they're yelling at you to be a dick. It's like the f'ing military. That kinda brainwashing garbage needs to go.
Amazon and Wal Mart could disappear overnight and I would just shop elsewhere. Amazon isn't in charge of my water quality or road maintenance.