See an orthopedic doctor. A simple arthroscopic surgery may be all that's needed. The doctor looks inside the joint, finds the problem, and repairs it all in one procedure. A special tool called an arthroscope makes this all possible.
The scope is a slender device with a tiny TV camera on the end. It is placed through a small opening made in the skin and goes directly into the joint. No incision or open cut is needed. Special tools can be passed through the scope into the knee. The surgeon is able to see and work inside of the joint.
Even if you've been able to unlock the joint in the past, it sounds like it's now time for diagnosis and treatment. The longer that problems are left untended, the less likely
a simple repair can be done. For example, torn cartilage in the knee can be repaired in some cases instead of having to remove the cartilage completely. Keeping the cartilage
protects the joint much longer than removing it.