Your knees probably hurt for two reasons: (1) they may not be adequately aligned and (2) they are stiff because they never reach full mobility. This is a catch 22 situation. Joints get stiff from a lack of use (a lack of movement), and stiffness in the joints stops them moving to full capacity.
Another reason that people cannot squat is that the thigh muscles are too weak.
You can do three things to learn to squat again.
1. Re-align your ankles and knees. How? Follow the instructions in this article:
2. Once knee alignment is corrected, you are ready to begin getting the knees fully mobile and flexible. This means folding the lower leg to full capacity until the foot touches the butt.
3. Finally, learn to strengthen the thighs by doing half squats, and gradually working your way down deeper into full squats holding on to the kitchen top while waiting for the potatoes to cook (or something).
Put this advice into practice, and you'll be able to squat again in a few weeks time, no problem. But don't overdo it, remember my motto: No Pain, Just Gain.