I have severe pain in my knees what could that be from? It mostly affects me when bending the joint

Anterior knee pain. Anterior knee pain associated with activities that require knee bending is mostly due to imbalance between quadriceps muscle pull. In late stages it may be frank osteoarthritis. Treatment depends on the duration of symptoms, your age, and activities that make it worse. Avoid those activities, strengthen the inner portion of your quadriceps and see your orthopaedic surgeon.