How to move on from a mistake

I made a really stupid mistake on my shift last week and it was reported to management who talked to me about it today. Pt is fine. It was a misunderstanding and I learned from it.

I’m really beating myself up and looking for new jobs bc of this mistake. How do you avoid all or nothing thinking?