Is this confidence to approach a woman or to build confidence in general? For the first my suggestion is simple. Even if you really, truly like the girl and find her to be the most beautiful specimen upon this earth, do not act as though you feel that way. Approach her within a manner of casual acceptance of thinking that you can always find someone else; that you do not really need her. Do not be an a-hole, obviously, but a woman does not really want a man who rolls over like a dog, reeking of desperation. By presenting yourself as a person with the ‘take her or leave her’ attitude you will show confidence but, more importantly, over time it will really sink into your head. Focus upon walking long enough and you can train yourself to walk however you desire.
As for general confidence building, because you were in the military your frame should obviously not be in need of improvement. Therefore I would
recommend reading some Stoicism, find an inner calm. Inner calm presents itself as confidence and slowly you will be able to accept anything life
throws at you calmly, rationally, and confidently. Lack of confidence is emotional so think of rejection, odd looks (real or imaginary), and people
talking about you (real or imaginary) as being unable to hurt you. How is that possible? Get rid of the judgment, the distinctions, get rid of the
“I am hurt” and you get rid of the hurt itself. Nothing, on its own, can emotionally hurt you; ONLY YOU can hurt you. Repeat after me: “Only I
can hurt me. I am the master of myself. I am the master of my emotions. My emotions are slave to my will; my will is not slave to my emotions.”