There are all sorts of training advice to get stronger. But in the moment, not feeling “knackered” is about appropriate pacing and gearing for the fitness you have. Long climbs start a bit slower than you think you can maintain, and then build speed and effort gradually as you get farther up the climb.
Also, the climb’s not over until you reach race pace again over the top. So manage your effort so you can ride strong over the top and get back up to speed.
__________________
You could fall off a cliff and die.
You could get lost and die.
You could hit a tree and die.
OR YOU COULD STAY HOME AND FALL OFF THE COUCH AND DIE.