This is a conversation I have with almost everyone who comes in for stretch therapy because they are in pain from an injury or simply from overuse/repetitive movements that are related to either exercise, sport, or work. When we start to feel discomfort in the body and we notice it occurs during particular movements, we naturally avoid those motions to the point of discontinuing all together. This is the beginning of the cycle that actually makes the issue of pain even worse as the muscles have only gotten tighter now and circulation, which is what keeps the tissue healthy, has also decreased. For starters, get in to see someone who specializes in body mechanics (chiropractor, a pain management doctor, a physical therapist, an advanced massage therapist etc...) and if you can, look for that person to be someone who is also an advocate for being physically fit - if they aren't active themselves, how can they relate?
Next, start to move again. When I work with clients who have chronic or even acute symptoms, I send them home with 2 new movements (exercise or stretch) to work on for the next 5-10 days straight. These motions can be related to the area of discomfort - as they say, it takes a village...through surrounding muscle groups that are also players to recovery, so homework of movement selected are those that don't cause pain. "No pain, no gain", is totally tossed out the window in my office. I also aim for individuals to regain strength lost, so they have to push themselves a bit but I still keep boundaries established as well based on the circumstance. The difference you want to have an understanding of is, beginning to move again may make you sore like you've had a workout vs. the pain you have been experiencing returns or gets worse.
To continue recovery and maintain (this is where a lot of people stop), find some form of exercise you like so you will keep doing it. I have had individuals come in for weight training and I can tell they can't stand doing it which also indicates, they won't keep doing it on their own. Weight training is only one of many forms of exercise. Look into pilates, swimming, or yoga and get some body work into your regimen consistently. We take our cars in every few months for tire rotation or oil changes, but we don't do anything for the bodies we put mileage on - are parts are also not easily replaced! Inquire about advanced medical massage therapists, rolfers, stretch therapy, or acupuncture to name a few. Sometimes our aches and pains won't/can't take care of themselves - don't avoid a solution!