Make sure the bike you are using fits your body. Your local bike store should be able to tell you if your seat position is decent. If you are using a previously loved bike make sure its chain is oiled and things are working. Tires are aired up, etc.
Depending on the type of geography you live in, make sure you have a bike with some lower gears. Biking isn't surprisingly about gutting it out to get up the hill; it's more about putting your bike into a low enough gear that you can spin at a cadence of 80-110. That's right, more revs of the pedal crank per minute, not fewer. Word of caution: When you are in low gear and you're not making a cadence of 80, so be it. Either keep going or walk it up the hill. Listen to your body. Either is acceptable.
If you are new to biking, you don't want to go buy a lot of stuff, but try to position your foot so that your ball of your foot, or just behind the ball of the foot is on the pedal. Notice your foot on the pedal, Experiment with toe versus toe out. You actually want it to be pretty neutral as I understand it; toes straight ahead. Experiment with very slight changes to toes in, toes out--NOT dramatic--to see if that helps your knees. Anything that strengthen the quads and hamstrings often helps the knee.
Keep it fun. Anything that makes you say, "Well I NEVER want to do THAT again," was too strenuous. Compare your progress to your progress. Towards that, a simple odometer on the bike that will tell you miles traveled, speed and average speed and cadence (which is debatable) can help you make those comparisons.
If knee pain persists talk to your doctor or maybe have a PT evaluate your lower body strength.
2011 Trek Madone 4.5 WSD
2011 Trek FX7.2--What can I say? It was on sale!