You'd be a very special person if you could figure that shit out beforehand.
Unfortunately, it's only hindsight that that puts things into perspective. You just have to accept that self doubt is a defense mechanism, and not a flaw. Just as impulsiveness is an opportunity mechanism, and not a flaw.
Sometimes you miss out on that tasty treat. Sometimes, you get burnt reaching for that tasty treat. That's how life works.