Start quietly, especially if there are other customers around. Give the shop, restaurant, etc a chance to sort it out without any embarrassment to anyone.
Be calm - keep your head, and don't cause a scene if you don't have to - let them lose their cool and cause a scene - then at least, to everyone around, you look like the innocent victim!
Keeping calm is more difficult in person than it is in writing or on the phone - but it's very important!
Be firm and assertive - state what the problem is, and state exactly what you want them to do about it. Assertive does not mean loud (well not always!). Simply insist quietly that you want the problem rectified.
Ask to speak to the manager / supervisor. Don't accept excuses like "Oh he's not here" or "she's out at lunch" etc - say "OK who can I speak to here" or "Can I use your phone to call your head office" or "OK I'll wait till she gets back". Be persistent!
Be amusing if you can - OK I know that's not for everybody, but if you can, make them laugh - at least they'll remember you later if you write in! A bit of humour also helps you to release the tension and stay calm - so even if it's only you who gets the joke, it's worth it!
Please, please, please, don't pretend to be something you're not - saying "By the way I'm a health inspector or a hotel inspector ar a trading standards officer (delete as appropriate)" isn't likely to impress them at all. REAL "ditto ditto ditto" people don't say so, and the result is, you look silly and desperate, and when you lose your credibility, you lose...full stop.
One of three things can happen at this stage - either
(a) they acknowledge the problem, apologise and give in, and discount the bill or accept the blame or offer you a freebie etc, just to keep you quiet or to genuinely make up for their error; or
(b) they dig in for a long siege and try to wear you down. At this stage it's very important that you don't give up. Maybe getting a little louder (calmly now!) will help, if there are other customers around. Involving other customers might sometimes be a good idea, especially if there's someone else there with a similar problem who is taking an interest in yours! Ask who you should write to. Get the address. Better still, get a name - you want to deal with a person rather than a faceless company. Then leave.
(c) they try to frighten you, and threaten to call the police. This has happened to me a couple of times. Stay calm, Stay where you are. Call their bluff. Don't shout. Never threaten them. Stay calm and reasonable. And wait. When (or if) the police show up, remain calm. Explain what happened. Explain that they (the police) are really not needed here - there's no danger and no public disorder. Just a quiet discussion between you and a moron. (No, only joking, don't say that! Be reasonable!)