I moved to hilly area a few years ago: I now climb hills by standing on the pedals in a medium gear. I used to climb hills sitting down and "spinning" n the lowest gear, and sometimes stopping half way up to catch my breath.
I used to stand on the pedals for a few strokes before getting exhausted.
Now I can do it (stand on the pedals) for about 100 breaths (long enough to climb a steep little hill).
I deliberately practice on hilly routes. I've never practised only going up and down a hill repeatedly because I fancy that would be boring, but I also avoid sticking to the flattest routes because I'm lazy.
It takes me 20 minutes of riding to warm up, fortunately I start at the top of a hill so the up-hill is after I've warmed up. My most regular ride down to the river, and half an hour along the (flat river), and then home via half an hour of hilly route (ups and downs, slightly more up than down).
It took me quite a bit of practice, if you're younger than me I guess you'd need less.