When you see a hill coming, shift into an easy gear BEFORE the hill. As you start the hill, you may need to shift again BEFORE it gets too hard.
If you have a double crankset (2 rings on the front), be in the Small chainring on the front most of the time. The big ring is for downhill or flat road with the wind at your back.
If you have a triple (3 rings on the front), be in the middle most of the time, and in the small one for steep up hills.