How to make a mistake
Don't make a mistake
Mistakes are avoidable. "It was just an accident" is not a helpful attitude to reduce accidents. Be intentional and careful, if you don't know what you are doing, stop and ask for help or clarification. "I didn't mean to do it" only goes so far. Obviously if you meant to do it that's bad, but outcomes also matter, instead of "I didn't mean to" focus on "I broke it and now it's broken." Our goal and our standard is perfection. Even though we know this is not possible it's still our goal. We are all far, FAR from perfect, but we don't stop trying.
If you're making a mistake, stop!
A lot of times we make our mistakes worse by getting flustered and trying to fix them ourselves with involving others. We do this partly because we feel responsibility for our mistakes (which is good) and partly because we feel embarrassed about our mistakes (which is not). Sometimes we make mistakes worse by getting in deeper. Instead of being carried away by the momentum of a mistake it's best to stop and ask for help.
Don't try to cover up your mistakes, that only makes it worse. A good manager should not get angry when someone comes to them and says "I broke this" or "I messed this up" but should feel frustrated to find that "someone has broken this and has not said anything" or "someone tried to hide this issue" Hiding a problem does not make it go away, it only makes it worse. When a manager finds a broken tool or suspects someone is trying to cover up an issue, the blame might not find it's source right away, but suspicion and frustration grow to poisonous levels. On the other hand when someone owns up to a mistake it brings trust and forgiveness.
Even the best liars leave residues on their reputations. Just because nothing can ever be "proven" does not mean that a liar will avoid the cloud of question marks hanging over them.
You might feel bad for a mistake that you made, but nobody will know how you feel if you don't apologize. Even though it may seem obvious, it's helpful for your coworkers to hear how you feel. Showing willingness to make it right helps too. But remember, an apology is not a time for making excuses, just admit your mistake and leave it at that. In Christian community, nine times out of ten a humble and sincere apology is met with sympathy and forgiveness. The tenth time is the other person's issue, but now might not be the time to remind them (they probably won't hear you).
Forgive yourself and move on
And accept the forgiveness of others. Everybody makes mistakes, don't let a mistake, or even several, drag you down into negativity. Just because you screwed up doesn't mean that you are a screw-up, put it behind you, move on. On forgiveness: when someone apologizes to you; try not to say "it's ok" - which minimizes their apology, rather say "I forgive you", and make an effort to let go of the issue.