When you make a mistake at work, how you handle it can often say much more about you than the mistake itself.
Reasonable bosses understand that no one is perfect and mistakes will occasionally happen -- what they care about is how you follow up on that mistake. As it happens, there's a pretty foolproof formula for handling it well. If you follow this formula (and have a reasonable boss), you'll likely be surprised at how well he or she responds.
Here's the formula:
1. Tell your boss what happened -- immediately. Do not put it off out of fear. I will be far more upset if time is allowed to pass before I'm informed. Delaying sends the message that you value your own comfort over the needs of your work.
2. Take responsibility for it. Don't make excuses, and don't be defensive.
3. Tell me how it happened. Not only do I want to know, I want to know that you know.
4. Most importantly, explain how you plan to ensure it doesn't happen again.
This formula works because when someone makes a mistake, what a boss needs to do is make sure that the person understands the seriousness of it and knows how to avoid it in the future. If you take the initiative to cover those things yourself, then your boss doesn't need to do it herself (and having your boss impress upon you how serious a mistake was tends to be much less pleasant than saying it yourself).
In other words, do your boss' job for her -- eliminate the need for her to reprimand you by reprimanding yourself.
Why don't more people realize this?