Mindy Kaling’s advice is stellar:
Confidence is just entitlement. Entitlement has gotten a bad rap because it's used almost exclusively for the useless children of the rich, reality TV stars, and Conrad Hilton Jr., who gets kicked off an airplane for smoking pot in the lavatory and calling people peasants or whatever. But entitlement in and of itself isn't so bad. Entitlement is simply the belief that you deserve something. Which is great. The hard part is, you'd better make sure you deserve it. So, how did I make sure that I deserved it? [...] People talk about confidence without ever bringing up hard work. That's a mistake. I know I sound like some dour older spinster chambermaid on Downton Abbey who has never felt a man's touch and whose heart has turned to stone, but I don't understand how you could have self-confidence if you don't do the work.
There you have it, kids… confidence = entitlement + hard work. The last part of that equation gets forgotten quite often, unfortunately.