It’s very good to think that you are not the only one in pain. My sister has so much pain in her knee all the time, for many years. Also, generally in the world numberless people have so much pain in the hips or in the knees. Geshe Sopa Rinpoche took the aspect of having pain in the knee, but he had an operation and one leg got better, but the other leg was still painful. Geshe-la took that aspect.
There are many people in the world who have pain, not only you, so it’s very good to think this way:
Through my experience of this pain, may all mother sentient beings—the numberless hell beings, hungry ghosts, animals, humans, suras, asuras and intermediate state beings—be free immediately from all disease and spirit harm, including hip and knee pain. May they be free from the cause of the pain, delusion and karma, and not only that, may they all achieve buddhahood as quickly as possible.
In this way dedicate your pain to all sentient beings.
Recite this like a prayer or a mantra, just like reciting OM MANI PADME HUM or any mantra. This is the best practice to purify all your defilements and negative karma collected from beginningless rebirths, and not only that, to also collect the most extensive merits.
Dedicate to the numberless hell beings, hungry ghosts, animals, humans, suras, asuras and intermediate state beings. In this way you collect the most extensive merits and this causes you to achieve enlightenment, so you are very fortunate, unbelievably lucky.
This advice is from one great yogi called Choje Götsangpa. This is his practice and advice.
With much love and prayers ...