I have a problem with masturbation and feel pain in the knee joint, what do I do?

Stop. stop what is causing the pain, see your PCP for an evaluation. over the counter ibuprofen is good for knee pain. not sure what your masturbation problem is but you could seek out a psychotherapist that specializes in sexual problems.