I am 42 years old now and never swimmed in water. I would like to learn swimming so that I can swim 100 to 200 meters when required and get out.
Whereabouts in the world do you live?
Because in the UK/Europe (and presumably also USA/Canada and Australia/NZ), most municipal swimming pools run learn-to-swim programs on a regular basis, and the better pools offer lessons geared specifically for adults, separately from the kids (these days, in some jurisdictions, this may actually be a legal requirement). Swimming-clubs sometimes offer beginners' lessons as well. So if you live just about anywhere in the (urbanised) western world, it would be well worth checking what opportunities exist at your local/ nearest public pool.
If you
don't live in an urban area (or in the developed world), your options will likely be a lot more limited; but at the very least, you could start by checking out some YouTube videos on basic swimming technique: e.g. how to tread water, and swim front-crawl/freestyle (or breaststroke, but crawl is simpler to learn).
But if you want to try out any of those techniques, please, for your own sake, find a safe environment to do it in. Ideally that would be a purpose-built swimming-pool, but any body of water which is swimming-pool-like, should be OK for swimming practice: it should be sheltered (no waves), calm (no currents), warm (>20°C would be best, but even >15°C would still be OK, provided you didn't stay in too long), and ~1 meter deep.
(Depending on how tall you are, you'd need ~1.5 to 2 meters to be able to practice treading water).
As a general rule: if you don't know the water-depth/conditions, then it isn't safe to (learn to) swim in. Also VERY IMPORTANT: while you're still learning the basics, then wherever you decide to practice, you should
only do so when a competent swimmer (lifeguard, friend or family-member) is present to watch over you, and able to help you out in an emergency (even in shallow water, e.g. muscle-cramps or hypothermia can be crippling, and hence dangerous).
And before you've mastered the basics (e.g. you're able to tread water for 5-10 minutes, and/or swim ~200 meters without stopping, and without getting out of breath), definitely DON'T try to swim in (more) challenging conditions.
So basically, when you are swimming, you keep your head above the water and keep breathing normally. Right ? Air in the lungs keeps the body above water ?
You're not a whale (they have their nostrils on the top of their heads!), so no, that's not really the best way to swim.
The head is the most solid/ dense bit of the human body, so the effort required to keep your head/mouth above the surface 100% of the time, is actually a lot
greater than it would be if you rather swim with your head mostly submerged, letting the water support that weight, and only bring your mouth above the surface when you need to take your next breath. A swim-coach (/good YouTube video) can show you how that works.