Medial Knee Drift (MKD) is the technical term for when you can't control your knee position during any portion of a squat or step-down exercise. This is probably one of the most common mistakes I see in the gym, even in athletes with trainers coaching them! Usually it's caused by weakness in the hip, which decreases control of the femur position. Heres one great exercise to do for firing the hip abductor muscles on both sides to help fix poor knee tracking which can lead to knee pain.
Stand next to the wall and bend your hip and your knee 90 degrees. Push hard into the wall with your knee, and you should feel the glutes on both sides firing.
Turning the glutes on should make it super easy for the standing (working) leg to track directly over your second toe.
Go as low as is comfortable, while keeping good form. Your back should be straight, and core engaged.
Start with 3 sets of 10 on each side.