Here's a technique we learned from 1984 Olympic road champion Alexi Grewal. Try it when climbing a long hill.
When you're working hard, it's natural to put the emphasis on inhaling lots of air. Instead, emphasize exhaling. Blow the air out aggressively, then let your lungs refill passively.
Why? Two reasons.
First, it gives you better air exchange. By emptying your lungs on each breath, they can take in more energy-producing oxygen.
Second, long exhales stop you from panting inefficiently.
When climbing, try breathing out fully for two counts (pedal strokes). Then let your lungs refill on the next two counts. This sets up a pedaling rhythm that puts you in control on long hills.
This breathing technique may feel awkward at first. But stick with it. Before long it'll seem a lot more natural. Then when you start getting gassed on a hill, switch to it and feel your effort become smoother and easier.