When people have knee problems (either chronic pain, or have had surgery or an injury in the past) they are tempted to avoid training the lower body. It's vitally important to strengthen the ligaments around the knee joint, as well as the larger muscles (quadriceps and hamstrings) to ensure that the strong ligaments and muscles carry the load of everyday life, rather than the joint. When the ligaments and the muscles are weak, all impact will fall upon the joint.
The wall squat is an incredible exercise to benefit the endurance of the lower body muscles, to protect the knees. Those who experience pain in the knees during the concentric and eccentric contractions (shortening and lengthening of the muscle), may have greater success with an isometric contraction (a contraction in which the muscle remains the same length, holding and enduring).
DO sit against the wall, with your lower back pressed back into the wall. DO have you heels right underneath your knees, or perhaps slightly ahead of them. DO make sure that the outside of your shoes (pinky side) are perfectly perpendicular with the wall behind you. DO make sure your heels are firmly pressed into the floor. DO sit slightly more open (higher) than a 90 degree angle in the legs.
(Photo here represents the incorrect form, whereas the opening photo represents the correct form - apart from her having her hands on the legs.) DON'T allow an arch between your lower back and the wall. DON'T have your heels behind your knees (closer to the wall), or TOO far ahead of you. DON'T let your toes point outward to the sides, or in too for toward one another. DON'T push all of your weight into the toes, or balls of the feet. DON'T rest your hands (or press) on your legs. DON'T (and this is the big one) dip lower than 90 degrees in the knees. This will cause the load and weight to sit in the knee joint and cause further discomfort (also taking the quadriceps from their high point of contraction).
Hold this pose / exercise for 8-10 to start, working your way up to 60, or even 120 seconds (for advanced).
**If you feel discomfort in the knees, don't attempt until you are working with professional. This exercise will greatly benefit all of your activities: sports, climbing stairs, walking, running... Sidenote - it is a sad reality that the only photo I could find of this being done correctly on the internet is cartoon!!
*internal photo found at www.menshealth.com *featured image found at www.fatburningtips4women.com