Think of your bike as having 3 gear ranges corresponding to the front chainrings. One for uphill, one for the flats and one for downhills.
Within those ranges use the rear shifter to fine tune your cadence. If your legs seem to be spinning too fast, shifter into a harder gear. If you're having to push too hard, shift into the next easier gear.