Mentally and physically
Don't train through pain. See a sports therapist. I have learnt to take better care of myself. Weakness, dysfunction, tightness, overuse.
People say: never allow yourself to whine, don't complain. Who the hell can do that? It's OK to get it out. I think it's essential.
The first thing to say is that it's OK to feel unhappy. Yes, it's even OK to cry. Our emotions are natural. By allowing yourself to feel anger, frustration, sadness you are already ahead of the game. You will be coming to acceptance a lot sooner. Note that acceptance doesn't mean complacency, but it switches are focus from wishful thinking, to reality. This is what the situation is. I'm here now, let's deal with it pro-actively.
Write a list of things you CAN do.
Find someone different to train with.
A yoga class? Swimming? Mix it up. This will help you avoid burnout anyway. When you get back, you'll be eager.
I trained with a bodybuilder and it was a lot of fun. I started more calisthenics, gymnastics and ring work. I became an upper body hero.
This is an opportunity to work on weaknesses, which will make me a better athlete. Strip everything back, focus on technique. There is always something you can do to improve.
Take care of yourself in other ways:
One idea is to write a list of things that cheer you up on a piece of paper. Then cut them out, put them in a box. When you feel crappy, pull one out of the box at random. (Go for a walk. Sing. Hang out with friends. Listen to loud music. Meditate.)