[NeedAdvice] My mental well being and motivation is entirely dependent on doing well at work. How do you bounce back from mistakes?

Title says it all, really.

I've noticed that when I do work competently, or am working on something, I am quite focused and feel very good afterwords. I end up being very efficient on personal tasks as well. But if what I'm working on turns out to be subpar or I make a mistake (i.e. miscommunication, accidentally missing project features as I am new to the job) I feel so awful that I just don't want to do anything the rest of the day, work related or not.

For example, I made a mistake at work today. Afterwards, I went home, laid down and just scrolled on my phone (now I'm on reddit). I already tend to forget to eat because of a medication, but when I feel like this I actively ignore the reminder alarms I have. I don't want to do cleaning or laundry or take a shower. I just feel immensely exhausted. I can't seem to really convince myself that I can go about the rest of my day as usual and that regretting something all day won't change anything, despite knowing this cognitively.

The same is true for habits or goals I set for myself. if I miss a day or two, it's like my mind thinks "Well, that's that. You failed and it's over, may as well not do it at all since you clearly can't keep a routine." and then I don't feel like trying again until weeks later.

I constantly combat this sense of disappointment in myself and the negative self talk buzzing in the background, and when it gets severe like today it basically kills my motivation to do anything. I just don't know how to emotionally bounce back or let it go. It's like a negative loop. What are things I can do to let go or vent my emotions so I can motivate myself? How do I keep the promises I make to myself without giving up entirely when I mess up once? How do you vent disappointment or anger?