It comes down to practice, when I started to travel (after years of sitting on ass in office and just walking around city) and came to Great wall at Mutianyu, it took me like 40-60 minutes to get all the way uphill with many breaks. Then roughly two years later after travelling across Asia walking every day kilometres, when I went there with my father I could almost run all the way up in like 10-20 minutes.
I walked recently with my kids (4+6y) ~11km on some tourist trail (very small elevation), didn't really have problem during hike, but could feel it in my legs later for few days since I am not used to walk that much anymore, nowadays I walk like 5-6km per day only.
Btw. my father will be soon 70, he is hiking regularly, can do 20+ km through mountains in one day.
Oh and like maybe year ago I started simple exercise routine (like <10 minutes but all kinds of moves) at home, no equipment necessary besides floor and wall, at beginning I could barely do 1-2 push ups, now I moved to 15 at one session (+20 sit ups, +15 squats and various other moves with neck, hands), but long time didn't icnrease the number, I'm sure I could push it to 18-20, you just need to start slowly, at beginning even 2 are OK, after few weeks you move to 5, after few more weeks to 8-10, then you move to 15, etc.