My mom is wicked smart. When I was a kid I would often say "I'm sorry" in a manner that wasn't good enough for her. She had a formula for how to apologize and amazingly enough it has proven enormously valid and useful. One drawback for me is now that I've been trained in how to apologize I insist on receiving apologies in this format from other people. They're not always so ready to do this and are sometimes genuine in their apology without doing the whole system, but usually I can recognize that and move on. Usually.
1. Look them in the eye
This is good advice whether it's about a handshake or an apology, but when you see kids apologize they will often look down when they do it. That's not good enough, you should look people in the eye. Perhaps you can't always look someone in the eye, but the real point here is to be genuine in tone and delivery.
2. Say I'm Sorry for X
Don't couch it in "I'm sorry for X, but..." or "I'm sorry for the misunderstanding." If you're really sorry you'll say what you did and not reduce the sincerity with limitations like "but." If you don't fully understand what you did wrong and why it was wrong from the perspective of the people you are apologizing you can never get better, and getting better is step 3.
3. Give your best assurance it won't happen again
People don't like being tricked twice. Give your best assurance that you will not let the event happen again. If you were careless offer to pay more attention. If you made a bad judgment call offer to get their advice.
4. Offer solutions and ideas to make them whole
If you can do something to fix the situation offer to do it. It's that simple. If you can't fix it you should at least acknowledge that it can't be fixed and offer to do something else to try to make it up to them.
This is great advice whether it's person to person or a company apologizing to their customers for a blunder or anything else.