When things are going perfect, confidence is easy. It's a natural byproduct of that success. But when you can generate a sense of confidence as things are going down the toilet, and you are not getting your way; doubt and fear and nerves are creeping into you mind and body; then that's a brilliant skill.
One way to do that, which Georges St-Pierre notes, is to act with confidence from by using your body. Pierre admits his fear and total panic before a fight, but as he walks to the cage he starts to walk like he's an unbeatable force and nothing will ever stop him. So by the time he reaches the UFC Octagon to compete, his body has convinced his mind that he is a fighter who is unbeatable.
We can take that same mentality in real life. We can sense fear and nerves and doubt creep into us, and at that point acknowledge it, but make a conscious effort to stand as tall as possible. Take some deep breaths and with every deep breath feel yourself being inflated further, getting taller, your chest puffing out with pride and extreme confidence. This is not an effort to deny your nerves, but it's something that breaks a pattern of going from fear to doubt to anger to hate to depression, or similar patterns which lead into a downward spiral. If you can break that chain and make a transition from feeling doubt, acknowledging that, and then segueing into a more empowering body posture, that's a very useful tool. Again, it's not a denial of your feelings, but almost a training for you to subconsciously pick yourself back up and not tumble all the way from the top of the mountain back to the base when things get rough. In the past, we have all unconsciously gone down that negative road, and it was just a result of practicing those behaviors and subconsciously always finding ourselves in the same pattern. If you can change that pattern you can change your subconscious actions, and you can change your life.