As others have said, to get better on hills you have to ride hills. I believe offseason weight training is beneficial, but that's not universally believed. Once you're on a non-training ride though, let the length of the ride and size of the hills determine your tactic. Short ride on rollers - attack and suffer, recover, repeat. Long ride or long hills - downshift and steady.