The thing to realize is that you're causing these issues in your own mind, which means you're free to not cause them.
Meditation might help, making a distinction between you and your mind allows externalizing and observing the mind in action.
Once you have managed that, consider giving retrospectives a shot. Simply walk through whatever situation you want to learn from backwards (starting with most recent events help) in your mind as an observer.
The problem with confidence is that it's a side effect of knowing and trusting yourself, and that takes real world experience.
Meditation might help, making a distinction between you and your mind allows externalizing and observing the mind in action.
Once you have managed that, consider giving retrospectives a shot. Simply walk through whatever situation you want to learn from backwards (starting with most recent events help) in your mind as an observer.
The problem with confidence is that it's a side effect of knowing and trusting yourself, and that takes real world experience.