I was reading an article for beginner triathletes about common problems in swimming. It mentioned a fear of difficulty in breathing. It said:

"When you get out of breath, the natural instinct is to stop, pull your head out of the water, and breathe. But swimming requires that you're comfortable with your face in the water -- a major source of anxiety for many new swimmers."

The paragraph basically states that when we're anxious or nervous, we want to breathe more often and get more air. As we get more oxygen in, carbon dioxide can build up which, in turn, makes us think that we need more air. We end hyperventilating instead of being calm. (Thanks to Triathlete Magazine)

I think that's a lot of the problem I have in swimming. I did take Total Immersion lessons and that has helped. If you're just learning to swim, try to relax and take it step by step. I wasn't scared of the water at all (in fact I love the water!) but when faced with a non-stop swim, I felt like I couldn't breathe. The more I practice, the better it gets. The less I practice, the more I have that "learning curve" once again.

Give it time, be patient, and it'll come. I know that's easier said than done because when I'm in the water I try to remember every little thing and I get worked up all over again. When I read the bit about carbon dioxide, I realized that it's a very real thing (this feeling that I need more air) and with that, maybe I can do something about it. So maybe do some reading too and you will see that so many people have the same problem and it is completely normal as you start swimming. And congrats for doing it