Confidence comes from competence.
If you're not confident at something, you haven't done it enough times. It's as simple as that. You want to execute so many reps, in various different scenarios, that it becomes second nature.
Confidence is about TRUSTING your ability
And your ability is dependent on the reps you put in, the feedback you implement, and how fast you're able to adapt.