If you hurt your _____ (fill in body part name) and it hurts to do any movement (here I used the example of a squat), your body is most definitely telling you that movement is not right for you right now. Sometimes, rest is really the best way to heal. If you sprain an ankle, resting it is one of the best first steps in recovery. But that's not the kind of pain I'm talking about here. What I'm talking about is that nagging pain that has been there a while (maybe since that ski accident 15 years ago) and it gets worse every time you do a specific movement (like a sore knee when you squat or shoulder in downward dog pose). You know what I mean right? We've all been there. It's annoying and hard to know what to do about it, so mostly we do nothing and simply avoid the painful movement. Some of us have elaborate stretching and rolling routines and see multiple professionals (like a massage therapist) on a regular basis just to keep moving.
Why is that a bad idea? If you stop doing a movement and don't address the underlying cause, you will never be comfortable in that movement again.
So how do you deal with a knee that is sore every time you squat? The simple answer is that you change the load. If there is pain in a movement, that means that the load in that movement is currently too much for the tissues. See if you can move through the range of motion without your body weight added (like a push up with hands on the wall instead of floor) or try to strengthen tissues in your pain-free range (like hold a 1/4 squat with pulses)
Check for differences in your range of motion on the 2 sides of your body at the joints involved in the movement. If there's a difference on one side, that could be your culprit. There's tons of corrective exercises out there to help you improve your range of motion. Check in with a good movement coach and they can help you choose good corrective exercises.
There may be some compensation patterns at play causing you pain as well. What's a compensation pattern? Well, if your shoulders don't have the natural range of motion to take your arm overhead, you will find that range of motion somewhere else. In a shoulder, it's common to extend the mid back and thrust the ribs forward or bend the elbow and even hold breath. From my experience working with people on an individual basis, the compensations we hold in our bodies are unique to each of us and are, for the most part, completely under our level of awareness. My advice? Take a video of you moving, watch it back in slow motion and take notes or consult with a good yoga therapist or other movement coach to see if there is a compensation at play that is causing you pain.
Get help! If you've got a trusted movement coach or manual therapist, book yourself an appointment. Because so much of our own movement happens below our level of awareness, having a second set of eyes can be so helpful. Get a massage or osteopathic adjustment to get your tissues back to a 'normal' tension or go for acupuncture to relieve pain. See a yoga therapist to help you retrain your neuromuscular connection. Whatever it is you believe in, go do it.
If you continue to skip a movement, you will lose your ability to do that movement, or at the very least, you will never improve at that movement. Having a bad knee/shoulder is not a life sentence, but it does mean that you need to invest some time in yourself to improve your function and decrease pain. If you want to improve, you can't just wish for it, you've got to do something about it and be brave enough to take a step back so that you can move forward from a more sustainable place.