This might seem simple, but it's probably the biggest key to feeling confident:

If you have an excuse, or a reason to feel confident, you will feel more confident.

It doesn't necessarily matter if that reason makes logical sense or if it's even real. It only matters that you believe in the story.

For example, in high school I once had to take a class that where everyone else in the class was one year younger than I. Because I was the oldest there, I felt confident as fuck in that class. Because I believed a story that me being older somehow made me cooler. Later i made it out with two women from that class whereas in my own "normal" class I was not able to accomplish this. And it's not like 1 year makes a big difference in maturity (i am also born late in the year). It's all about the story or excuse I told myself.

So think about what stories you tell yourself. Why do you think it makes sense that you should feel confident in a situation? If you tell yourself a good story about why you should feel more confident in a given situation - then you will feel more confident. Even if it's based on bullshit. You just have to believe the story. It has to be compelling enough. It has to make sense to you personally, even if it makes no sense to other people.