When trying to push your body to the limit injuries can happen and for some people, they can be quite devastating. I was recently working with a client who was about 6 weeks out from a meet and hitting huge PR's week in and week out. He was going into a squat workout using monolift hooks that go into a squat rack and during his top set he went to rack the weight and caught his thumb on the hook and ended up breaking his thumb and having to pull out of the meet.
When this happens you have two choices you can either sulk and complain about how unfair life is or you can look for the silver lining at the moment and find ways to keep pushing forward to make improvements. I think having great people around you is a crucially component for which direction you go and also your mentality of what the sport brings into your life is important. If you find the sport is how you identify yourself and your total is the only thing that matters you will have a hard time during this entire process. You must look to see how training and the sport make your life better outside of the total and if you have that mindset no matter the circumstances you will look to improve.
With this client, we immediately talked game plan and what's next and being able to have a gameplan right away will help a ton too. We are very goal-driven and need something to be training for a lot of times and if it is not a meet then we need to shift that focus to improvements on becoming healthier, improve flexibility, improve hypertrophy and improvement of weak areas. The idea is there is always something to work on and if you have an upper-body injury you find a way to training around it and if you can't do that you find other ways to train and improve upon weaknesses. If you think injuries are unavoidable I would highly recommend adopting this mindset, actually, just adapt it anyways and I guarantee you this sport will become far more enjoyable.