It is important to get is diagnosed or evaluated from qualified professional. Recurrent issue results from wear and tear or untreated condition.
Next Steps
Apply ice on an affected part before and after an activity, flexibility and strength of both hamstrings and quadriceps has to worked upon under supervision.
Health Tips
Please get it evaluated to acertain the source of pain only then treatment can be planned. Meanwhile ice application and isometric contractions with gentle flexibility exercises should help but under supervision.