Just a few thoughts from someone who, like everyone else, has made mistakes.
We all have to make decisions. It's easy to look back on the ones that didn't turn out so well - that job you took you didn't like, that relationship that ended badly - and beat ourselves over the head about it.
We all stupidly place ourselves in bad places at times in our lives - that's just part of life. Mistakes create the opportunities for success. Re-assess the situation and make another decision. Suck it up and move on to the next stage and be glad you'll live to fight again.
Keep a cool head, decide what to do, and do it. Don't listen to anyone else, think for yourself. Almost always, there's plenty of time to get it right if you just do it calmly, take the proper action and avoid panic. Don't berate yourself for your stupidity in placing yourself so close to disaster - it's not worth it. It's done and now you have to move on and make the choice that's right at this moment.
We all tend to overlook the good choices that we made and obsess about the bad ones. Make your choices and live with them, and just be happy that you had any choice at all. Sometimes the obvious choice is the one to make but it does turn out badly. You'll have future choices to correct it if necessary.