That brings up many more questions and possible outcomes.
Is it because of a past injury?
What is your training age/experience?
Are you able to completely bend your knee?
Does it hurt?
Next step would be to test some simple movements that could help me figure out what is the underlying issue.
A simple step up at mid calf height, done at a 303 tempo (3 seconds going down, 3 going up) can point out a few issues. If the upper body is rocking from side to side, the lower back (Quadratus lumborum) needs some strengthening. Does the knee go in? Most probably. The hip shifts on the side of the working leg? Both are the indication that the gluteus medius and/or the VMO or vastus medialis is weak.
Two simple exercises that would correct these issues are the Side plank and the step ups. For the step up, if your knee was buckling in for the step up test, the height to perform the exercise should be lower. Find a height that your knee doesn’t shift on the inside and use that height for 3-4 sets of 20 reps. The VMO, the tear drop muscle on the inside of the knee needs a lot of reps to activate. Who does high reps on squats?? Hahaha, good one.