Militaries solve this problem by having recruits repeatedly challenge themselves, doing tasks they think are beyond their capabilities, like repelling off a very high platform or surviving in a jungle for a week. You won't be doing this of course but the more stuff you try outside your comfort level the more confidence builds in your abilities. I would imagine same goes for programming, try to continually challenge yourself in your spare time with things that seem too difficult at your current level of understanding like going through open MIT courses, or join a jiu-jitsu class, hiking club, learn cooking, anything that is a challenge.