How do you recover?

So I have had situations where my tick was ruined. Either…

A: I made a fatal mistake. Dropped the cards. Messed up a false shuffle. Forgot the keycard. Dropped a coin from a palm… Whatever it is, this is to say that part way through the trick, I know that I’ve failed before the spectator knows it.

B: I pretty much finish the trick and the spectator correctly guesses how I did it, or thinks that they have and is completely unimpressed. “Oh so you just kept the coin in the other hand the whole time.” Or I have had where I’ve done the criss cross card force and even with some time misdirection people have said “wait, that’s just the top card, not the one I cut to.” Even if they are wrong, re-explaining it to them afterward just makes them think I’m lying and they were right.

C: They spot something they weren’t supposed to see and call it out as you are doing it, ruining it for the other spectators. Or they specifically try to ruin your trick and successfully do so.

Obviously you should practice the tricks and know them well enough to prevent these things from happening. But let’s say you are in the moment and the mistake has happened. How do you recover?