This is unfortunately recursive, but that's the way it works. You try something at the edge of your ability and accomplish it. Because you were successful at that, your confidence goes up. Then you try something harder, accomplish it, and your confidence goes up again. If you happen to fail at something, lick your wounds and try again.
Eventually, you don't need to play mindgames with yourself, you just realize that you're completely capable of doing what you set out to do.
I think it also depends on whether your confidence comes from within or without. For example, does one need external praise for something one has done in order to gain confidence? Or is it enough to just personally feel that a goal set has been well-accomplished?
Becoming successful and rich inspires confidence in a spiral, like what other posters have said. Faking it but always have something real--be it facts, good estimates, faith etc. behind to back it up also helps, I think.
Can't say I'm successful and rich, but I am confident and that probably came from doing things and getting positve feedback about them, and from inspiring quotes along the lines of, "Confidence, or the lack of it, is entirely up to you yourself."
IMO/IME confidence comes mostly from realizing that almost all failure modes are, in the grand scheme of things, impermanent and insignificant.
Worry less about what others think, worry less about most consequences, and just attempt whatever interests you. Pay attention to your mistakes and incorporate some learning from them in to your next attempt.
In essence: get better at what you love to do.
Teach. I've taught a college course for a semester and was the main trainer/teacher on a product/api we developed. Teaching others something you know will make you aware of how much you do know and how well you know it. And it is enjoyable if you don't mind the public speaking part.
I don't need other people's approval to make me happy. I derive my happiness from things that are very personal to me.
This leads to knowing exactly what I want, not caring about other people's approval and generally not needing other people or some particular thing to happen to get what I want out of life.
I now look people directly in the eye and its funny because you would have sworn I had aspergers before this.
Achievements incrementally build confidence.
View it as a first step. It may make you comfortable enough to take some of the subsequent actions you seek.
In a word, cross the door, then people will hold it open for you. The opposite doesn't work.
For everything else: as said by others, plan, iterate, think, correct, repeat.
Fake it, at least at first. It's a way of bootstrapping yourself into truly being confident. Act like someone that is confident, and do it enough, and pretty soon you my find that gosh you've actually become pretty confident!