For most people, failure is simply a part of life. For us, though, not only is it a reality with which we must contend, it’s part of the job description. Narrative Causality and the Laws of Dramatics do not want us to win—at least, not in any meaningful way. As a result, we—and particularly the career antagonists among us—need to get used to the idea of failing, and not let it control us. So instead of breaking down, what should you do in the inevitable case of failure?
Get out of there safely. While those of us who are already prone to ultimately harmless explosive exits have an easy time of this (at least, until that sudden stop at the end), many of us will find complications, often in the form of cardboard prisons, complicated justice systems, token house arrests, and other attempts to make us learn our lesson. These things pass; as long as we live, we will be able to remove ourselves. It just might take a little while depending on the competence with which such things are executed.
Figure out where you went wrong. Introspection and reflection are valuable tools, and it’s only a mistake if you learned nothing from it. If you had a plan, find the flaws. If you were making it up as you went along, figure out where your choices went bad. Judge yourself as harshly as you can; you want to learn from your errors, not excuse them to salve your wounded ego. (We do, after all, have very large egos on average; I consider anything that brings them to a manageable size to be a benefit.) If you can get a second opinion from a trustworthy source, please, do so; there are no faults we are as blind to as we are to our own.
Find a way to incorporate the failure into your plan. All actions have some sort of repercussions; surely something you did will come in handy later! Even a particularly abject failure can be leveraged into being underestimated later by the protagonists responsible for your previous downfall. I do, however, recommend against too frequent use of incorporating the failure by claiming it was in the plan all along; after a while, this looks like empty boasting rather than a cunning that transcends success or failure.
Do something different next time. For some of us, this means taking on an entirely new strategy, probably due to having learned of an actual inability to execute the original plan. For others, it simply means choosing different targets, preparing for different contingencies, or striking in different times or places. Figuring out what to change should flow naturally from figuring out what went wrong.
Failure happens. Your job is to happen back at it.