The most useful tip I’ve ever read for cycling came in two sentences:
If the front of your knee(s) hurts, raise your saddle. If the back of your knee(s) hurts, lower it.
About three months ago I started experiencing some knee pain after I had my Cannondale worked on – tune up, stem raised, simple stuff. A week later, with a serious mileage increase, my left knee started hurting (in front). I remembered reading the tip so I raised my seat about 1/4″… Sure enough, the pain stopped within a day or two and never came back.
Of course, it should be stated, if you’re new to biking, buy a bike that is fitted to you by a pro. They’ll take things into account that, as a rookie, you won’t know about.