Injuries can happen for many different reasons and there is obviously a vast amount of different types of injuries that can occur due to different reasons. You can sprain an ankle by landing on it awkwardly or you could develop a chronic injury overtime from poor technique. It is also possible to cause injury from overuse of a muscle; this is typically a result of training error. Trying to do too much too quickly or using wrong technique too often. An acute injury like a sprained ankle can sometimes just happen at random, but there are still steps that we can take to help prevent further pain and damage. Likewise, there are steps to take in preventing chronic injuries from occurring in thing first place.
1) See a professional about it, getting it sorted earlier will not only get you on the path to fixing the issue sooner but it also could potentially save you from further injuries happening due to poor technique caused by being hurt.
2) Train around your injury. For an example, running is no longer an option due to pain caused by shin splits so instead go for a low impact cardio option such as swimming or use the elliptical. The likelihood of you being able to train around your injury will vary greatly depending on the injury but it's always a good question to ask someone informed what can I do exercise wise.
3) Set SMART, MEASURABLE, ACHIVABLE, REALISTIC, TIMELY goals for your road to recovery. Don't forget about your pre-existing goals but realise that you may need to set some S.M.A.R.T new ones in order to get better. If it takes one step back to go two steps forwards then so be it. Day to day you might employ a rating system out of 10 to access how painful the injury is and to help see the rate of which you are recovering.
4) Stretching is a great tool to use in the prevention of injuries. Before exercise warm up and perform dynamic stretches and after exercise don't forget to cool down and do static stretches.
*Disclaimer: Individual results vary based on agreed goals. Click here for details.