Try a Modification to the Squat
You can use a wall to help support your back while you slide into a squat position. Make sure the knees stay behind the toes and only slide down as far as you comfortably can.
Use a chair as a guide for your body to follow and to provide support at the bottom of the movement. You can even (briefly) sit down each time to take the pressure off the knees if needed.
Like wall slides, a ball can provide support for your back, helping keep your knees from going too far forward. Just make sure you walk the feet out enough that the knees stay behind the toes.
Sometimes, just shortening your range of motion and only squatting down a few inches can help protect the knees.
Squats with a Ball Between the Knees
Many people find it easier to keep the knees in alignment by squeezing a ball between the knees. This will also involve more inner thigh.
Squats with a resistance band
If your knees tend to fold inward, tying a band around the knees and pushing against the resistance may help.
Because your range of motion is naturally shorter in one-legged squats, you may be able to do these without knee pain. For this move, you only squat a few inches and you still need to push the rear backward to keep the knee from going over the toes.
Changing your stance can also make a difference. For these, you take the feet very wide, angling the toes out. As you squat, the knees should follow the same line as the toes.