After being injured while exercising you will have to enter a rehab period. Unfortunately for many people rehab is not fun because it means they are going to have to significantly cut back on their physical activities and spend a great deal of time resting.
While you are undergoing rehab it is important to remember the R.I.C.E. principle.
This stands for rest, ice, compression and elevation. Depending on the severity of your injury and the length of time you have been injured you may be past the elevation and compression stages however rest and ice are probably still a good idea.
Resting will help give your body time to repair any damaged muscle or ligament tissue and the ice will help to take down any inflammation or swelling that is occurring. Furthermore, it is still a good idea to try and work the muscles that are not injured as much as you can so that you do not see a significant drop in fitness level. For example, if you have a sprained ankle or some other lower body injury, there is nothing stopping you from completing some upper body strength training. You will find that this will also aid with the psychological battle of 'taking time off'.
Finally, one last consideration while you are taking a break from your usual workouts is that you may want to pay a little more attention to your nutritional intake during this time. Since you are likely to not be quite as active it would be smart to slightly reduce your caloric intake to account for the fewer calories you will be burning on a daily basis.
If you fail to do this you may find that your weight is going to start creeping up on you, which will only make the situation all the more stressful.
So next time you get injured, keep these principles in mind. As long as you see a doctor and follow their orders and do not push yourself to keep going with the activity you can be sure you will be back to your workout as soon as possible.