Familiar pattern: do something dumb, then feel bad.
Why feel bad? Is it some kind of atonement? “If I feel sorry for myself and mope then it makes it OK that I did something dumb”. Is that the reason?
If that’s the case, it’s like an apology. Say something stupid, then apologize, thinking that it negates your responsibility for what you said.
The critical flaw here is voluntarily adopting a negative emotion to internally compensate for a concrete action taken. As if present tense internal states can affect external, historical events.
It’s a habit, this remorse thing. Stop the if/then cycle. Drop the wallowing. You’re not a wallower. Stop the self-lie that you’re just a sad or depressed person.
If you can cut out the emotional reaction and just do dumb shit and look at your behavior dispassionately, you have a chance to change the actions. Pull your head out of your own self-loathing ass and observe what is actually happening. And change it.
This is not to say that you have a license to be an asshole. You don’t have the right to harm others. You are mortal and fallible. You will make grievous errors. The point is that it is possible to do fewer dumb things. Stop talking to yourself in your head–moaning about the past and things you’ve done. Make amends as best you can, then move on.
When you’re feeling bad about yourself for your own actions you’re not living in the present moment. Which of course is a guarantee that you’ll fuck up something else.