Pain is normal when you damage your body; it tells you something is wrong. When injured, you need expert advice on what the problem is and how to manage it and you should rest, for maybe a couple of days. Yet there is a widespread belief that if a part of your body still hurts, you should withdraw from the activity that causes it. This is often a mistake.
Research shows there are beneficial outcomes from a return to activity, even when pain exists. It will improve the results, on a tissue level, and by releasing endorphins will help reduce the pain intensity. For instance, if you injure a tendon, and rest it completely, without applying a certain sequence of movements, you can get disordered repair. That becomes a weakness in the tissue. If you get rehabbed by an osteopath or some other medical practitioner, however, you will be aligning the collagen in the tendon and giving it a more controlled repair.
The same principle applies to healthy people. If you're slouched at a desk all day and then go home and watch TV it could lead to problems. We see a lot of trouble with desk workers' necks and shoulders because they're not moving their joints through their full potential. Think about what movements your joints are capable of, and take them through those ranges with a gentle stretch.