Learn from shortcomings, don’t dwell in them.
Over the course of your professional life, you will fail, and you’ll probably fail more than once. No human is infallible, after all, that’s part of our charm. Maybe you’ll fail in some small way like putting your foot in your mouth during a chat with your boss. Maybe it’ll be something more severe that puts your position in jeopardy. You can plan for things, but those kinds of failures have a habit of sneaking up on you at the last moment. This is why, as important as it is to do your best at your job and try to slip up as little as possible, it’s equally important to be ready to accept a loss and learn from it.
To quote a certain robotic monk, pain is an excellent teacher. When you mess up something at work, you’re probably going to feel like garbage for a day or two, and that’s okay. We all need some time to feel like garbage now and again. But once you’re done moping, you need to take a hard look at yourself and what happened, and ask yourself “what went wrong, and what can I do better?”
What was the root cause of your slip-up? Was it something you did? Was it something someone else did? Could it have been prevented, and if it couldn’t have, could it have been mitigated? You need to consider these things calmly and analytically; if you start spiraling, you’re just going to freak yourself out, and that won’t help anyone. There is almost always a right answer, and with a little brain power, you can find it. Beyond that, as I said, once you’ve had your moping time and your thinking time, you need to stand back up, dust yourself off, and keep on trucking. The pain of that mistake will likely be there for a while, but as long as you properly learn from it, it won’t be able to hold you back from being your best self.