I concur with some of what Namsag says:
Don't hold your breath!
Suprisingly, if you concentrate on breathing out at the right time, then just open your mouth, at the right time, air will rush in!
So, a couple of points; Think of the power phase of your arms in breast stroke, (not the power phase of your legs!) as Namsag says, that is the time to breathe in, so make sure you've exhaled hard just before. Think of the way a whale exhales when it surfaces, almost like an explosive exhale, which also clears the droplets of water from around the mouth, then when you inhale there's much less water to contaminate the air that you're breathing in. Don't leave it too late! Experienced swimmers exhale into/under the water!
The phases of breast stroke are: Kick with your legs, (it's the inside of the feet/legs/ankles that do the work, like a Charlie Chaplin walk, but think of your two feet moving backwards at the same time. Practise sitting on a chair or sitting with just your feet in the water and feel the resistance.), glide (arms extended forward, hands together, legs extended backwards, feet together, face in the water if you're confident), pull with your arms (think of both outside edges of the hands scooping clean the inside of a pastry bowl, then presenting that 'scooped' amount to someone else.).
I don't agree with Namsag 'cos your arms should never come further back than your elbows. Elbows go high and hands come underneath them.
So it's kick, glide, pull. And the pull phase is when you breathe in. So blow out hard at the end of the glide phase.
There is a practise you could do to gain confidence which is a survival technique. It might take time to reach a certain level of ability to try this. Once mastered you'll never worry about water again.
You'll need to be confident about putting your face in the water and holding your breath, blowing out into the water then just lifting your face to breathe in and putting your face straight back in again.
You can easily practise this bit holding onto the side in the shallow water.
Literally float vertically in the water in a depth that you can stand up, but for the excercise just bend your legs up behind you. You could hold your ankles there with your hands;
When you breathe in you'll feel yourself rise slowly, blow out and feel yourself sink slowly. Floating vertically all the time. You won't sink much further than your forehead! It'll take minimal effort to raise yourself sufficiently to breathe. Just lift your face up.
Once you're confident with rising and falling with breathing go the whole survival technique;
Floating vertically in the water with your face in the water, blow out hard and before you've sunk further lift your face so that you can breathe in. You'll rise slightly again. Just float there whith your face in the water, holding your breath. When you want to breathe out, blow out hard, lift your face and breathe in again. You may need to lift your face so that you're looking at the ceiling!
I wouldn't reccomend anyone learning to swim in the sea, it's too rough, too cold and it tastes awful!