Disclaimer: In my minimal experience so far...
Find a cadence
(pedal RPM) that works for you - Not so fast that you're having difficulty with it, but not so slow that it's causing you to heavily 'mash' on each stroke. It should be relatively easy to pedal, but it will probably be a bit faster than you might at first have anticipated. For me
(in my current out-of-shapeness), 80 to 90 works pretty well. 80-sh on the flats, but a bit more
(downshifted) going uphill.
An appropriate cadence will also save your knees over the long run.
Once you get a feel for that cadence, shift to maintain it and don't worry too much about what speed it is. That way you'll tend to somewhat level out the effort you have to make over varying terrain. Your speed will vary with the terrain, but not your cadence.