The most important part is to get yourself to the point where you feel mostly at ease in the water. You can train yourself by spending a lot of time in the pool. Start in the shallow end, sit on the stairs or just squat down, stick your face in the water, and blow some bubbles. Pull your head out, take a breath, and go back in. Do that for a while, then pull your head out when you start to need air but stick your face back in the water immediately without taking a breath. You can stand up anytime you like, so take a moment to notice that your need for air wasn't as urgent as it seemed. You can stay under a few more seconds before lifting your head out again, and when you come out, take a relaxed deep breath instead of gasping as if you were dying. Show yourself that you are in control and doing just fine.
Keep playing games like these. Get a little deeper, go farther under water, do little flips under water, and so on. When your face is pointing up, the air sometimes comes out of your nose and cold water rushes in and hits your sinuses--nobody likes the feeling, but after a few times, it won't be anything more than an annoyance, so just spend a lot of time getting used to all of these feelings. That's what kids do. Kids get their heads pushed under water by bigger kids, and before long they realize that it never kills them.
Take as long as you need to play around in the water (weeks?, months?, no rush) and get used to all the new feelings. And then take another swimming class and learn the skills without all the anxiety. (And assume you'll have to keep going back for your own underwater therapy refresher courses occasionally for the rest of your life to maintain your comfort level.) Hope this helps.