If you’ve made a huge mistake at work, your first response might be to panic. You might fear that your job or your whole career is over. But chances are that you aren’t the first person to make a mistake at your company, and you won’t be the last. How you act after making a mistake often matters more than the mistake itself. Attempting to deny or cover up a mistake makes the situation worse and would likely be grounds for dismissal while taking responsibility can go a long way toward fixing the problem and repairing your reputation.

Handling a mistake in a professional and humble way can even increase your colleagues’ respect for you. When people see that you own up to your mistakes and sincerely try to make them right, they learn that you have good character and that you can be trusted to do the right thing.

1. Report your mistake

As soon as you realize you made a mistake, tell your manager. Don’t wait for your manager or coworker to discover the mistake. If you don’t come clean about a mistake right away, that can cause your employer to question whether you intended to hide your missteps or whether you were trying to sabotage the company. Being transparent about your mistake shows that you did not intend for this mistake to happen; it also gives your employer a reason to be more forgiving.

2. Document what you did wrong

Write down the details of your mistake, including the date and time, what you said and did, the names of anyone you spoke with, and the amount of money involved (if you made a mistake in a financial transaction). Creating a record of your mistake serves two purposes. First, it makes it easier for you and your colleagues to correct the mistake. When you have a record, you don’t need to try to piece together what happened from memory or search for where you went wrong. Second, documentation protects you in case there’s a dispute about your mistake. Having an accurate record discourages colleagues from exaggerating your mistake or accusing you of additional wrongdoings you didn’t actually commit.

3. Apologize

Apologize for your mistake to your employer. Don’t offer excuses for your mistake, deflect blame for it, or try to downplay its significance. Simply say that you’re sorry and that you take full responsibility for what you did wrong.

4. Offer to correct the problem

If your mistake created more work for other people or resulted in work being thrown out, offer to do whatever is necessary to make up for it. For example, if a presentation had to be discarded because you used revenue data from the wrong quarter, offer to work over the weekend to recreate the slides with the correct information.

5. Create a plan to avoid this mistake in the future

Discuss what went wrong with your supervisor, and come up with a plan for preventing the same mistake. Your plan might include getting additional training, using a checklist to remind yourself of essential tasks, or shadowing a mentor to see how a more experienced professional handles similar situations.

6. Accept consequences graciously

Depending on the severity of your mistake, your employer may impose consequences such as reduced responsibilities or closer supervision from your manager. Don’t grumble about your employer’s response, even if you feel it’s too harsh. Instead, go along with your employer’s decision and cooperate graciously. Focus your effort on doing your job well and proving that a one-time mistake doesn’t define your work going forward.