Short answer: there is no use.
If it doesn’t feel good to feel bad then why not try something else?
It’s easy to feel bad about yourself when things go wrong but ruminating on that feeling isn’t likely to help you improve and get better at whatever you’re working on.
Perhaps asking yourself ‘what could I have done better?’ might be more useful.
Then take whatever is on that list and give them a go one by one until you find something that helps you improve.
I have no doubt that will be much more useful than the previous approach.