Trying to attack hills is fine if you're young and fairly fit with the ideal body type. Get a bit older and all that goes out the window. And too many people don't think about those things when giving advice.
For longish hills, you need to sit and spin your way up. Speed is irrelevant if you've killed yourself in the climb and have nothing left to go on with. So, you need to keep your heartrate in the 120-130 range and go up the hill in easy mode.
As you do it more often, your leg strength will improve and you'll be able to change gears and maintain the same heartrate/breathing while picking up speed in the climb.