You should probably get fitted, or at least read about it. Almost all of the books I've seen give about the same decent advice. The 90%-effective saddle height rule is that if you put the heel of your foot on the pedal axle (not the way you normally pedal) at maximum extension your leg should be dead straight -- no liftoff, no knee bend. That tends to maximize efficiency, power, and knee life. And your normal pedaling setup should have the balls of your feet over the pedal axle, more or less. If you catch yourself shifting from side to side when you pedal, that's too high, knock it down by 1/4-inch increments till you are happy. A little less height than the rule-of-thumb "optimum" is no big deal, but you want to avoid having your knees bent too much. I'm also assuming you are 6' tall or more, in which case there is no need to worry much about crank length (once you adjust gearing for reduced leverage, shorter cranks, e.g., 165mm instead of 170) are slightly easier on your knees. Tall guys with good knees sometimes go for 172.5 or 175.
Other rules of thumb -- too high is bad for your hips, too low is bad for your knees (plus you'll get serious burn in your quads).
Once you get close and find your happy place, you'll find that a millimeter here or there will make a difference -- the saddle tilt should be just so, the seat height, etc.
And if your knees are dicey, aim for a lower gear -- not spinning wildly, but back off from mash-mash-mash-mash. I'm 53, some days my knees feel a little off, I baby them till they are warmed up. Also, keeping them warm on cold days is a good thing.
I'm lucky enough that all this works like physical therapy for me, but if it doesn't work for you, find a professional. And you may have the sort of knee problem that cycling doesn't help -- those are not common, but they happen.