Positive thinking is important. Learning to take a step back is good. But we can prepare for it too. And not in the "omg what if the worst happens" sort of way.
Even looking through my best games, I see where I made mistakes that could've given my opponent the initiative. It sort of ruins them. Even in good games where I did pretty well and beat a strong opponent, I made mistakes. Perhaps I even blundered before playing a strong attack.
With the advent of computers, we can see factual evidence and data that, yes, we make a lot of mistakes every game, and perhaps our "fatal" blunder was not so fatal and we had chances to win even later, but we just overlooked them, or a crushing-looking move ... wasn't.
I try to sit back and nod my head, maybe even run a tune through my head. Maybe a song about how the past is over. Just the chorus can work. Foreigner's "That Was Yesterday" or Eddie Money's "I Wanna Go Back." Or sometimes if I realize right away my position isn't so bad, Simple Minds's "Alive and Kicking." Nothing super-outright-motivational or run through a brick wall stuff, but one that works for you. And you don't have to worry about what the song really means or if you're bowdlerizing it. Gloria Gaynor's "I Will Survive" is also a good choice.
But the main thing is, instead of using energy to beat myself up, I save it for awareness. We all say we want to, but having that computer data of how frequent blunders are in below-master level play helps, and framing it as what to focus on vs. what to avoid helps a lot.
What did my opponent miss? What might they miss? Did losing material free my position unexpectedly?
You can't expect your opponent to slip up. But give them that chance. They might get frustrated you started playing better. Oh -- and study your games for when opponents came back from a blunder. That hurts, but somehow, those are easier to remember when you need to pull a position out of the fire later.