Wait for enough confirmations where the payment becomes unlikely to reverse, which of course takes time and that's the more practical blocker for regular shops to accept Bitcoin.
They aren't doing that, in places I've seen, they just take your payment and let you go away with that. (I've never paid myself, but I've seen other customers do so)
If it's raw bitcoin, they couldn't even be sure that the transaction is a valid one (that the wallet has the funds in the first place, not even talking about double spending). I suspect they use some kind of third party like Coinbase, and that there aren't really using bitcoin at all (and just use Coinbase as a bank) but I'm not sure.
Thanks. I'm not sure I understood the answer given in the specific post you're liking to (or at least, I don't see how it answers my question). A following response linked to this story: https://www.ccn.com/bitcoin-atm-double-spenders-police-need-... which gives a pretty good answer.
There are 2 approaches to Bitcoin Network usage in play. Bitcoin Core team went with RBF(Replace-By-Fee) which gives rise to the double spending problem as the funds can be re-directed before a transaction gets in to a block. And Bitcoin Cash protocol implementation removed the RBF to support trust in 0-confirmation. There are even more optimizations in BCH implementation of Bitcoin, you can review it here https://cash.coin.dance/development
From my quite limited understanding, RBF basically allows to cancel a transaction (since you can set the fee to something that would never be accepted in a block) which is even worse than a regular double spending, because in the end, nothing at all is spent.
But even without RBF, there's nothing stopping you from spending the same coins online and in a restaurant at the same time. I'm not even sure if a restaurant would know that you and you're friend aren't actually spending the same money twice for your respective meals.
0-conf transactions have timestamps and the receiving wallet/node checks for the tree of transactions to even allow the spending of unconfirmed transactions up to a limit of 25 for now, there is on-going research and testing to up this limit to 500 that was sponsored by SatoshiDice https://twitter.com/PeterRizun/status/1181980303033692162
For a list of transactions trying to double spend BCH and failing at it, see this https://doublespend.cash/
"Digital cash" is really the best way to explain the uses of it. Cash is still useful as well. And, equally, don't fall into the cashless utopia "why would anyone want to use cash except criminals?!" trap either.