Grief and loss
Bro. You are grieving the insurmountable loss of best friend. It's perfectly normal to experience an array of emotions that include anger, compassion, depression, sadnes, etc (see Kubler Ross). Honoring your friend means staying in the fight- something any marine or soldier would tell you. Some days will be better than others and in many ways, some minutes will be better than others. Expect difficult times and painful rememberances but also...joy. Celebrate the life of your friend and worker harder now than ever before as he would expect this of you. Balance your thinking with positive and negative memories. Take some time to grieve working toward acceptance- it's a process and keep moving forward. Bereavement can mimic if not turn into a significant depressive episode if you become isolative, withdrawn, and/or avoid the things you enjoy. The gym may trigger a host of unexpected emotions and memories but it isn't something you can continue to avoid indefinitely. Schedule a day to return to the gym continue working on your goals. Shoulder the burden and know your friend is fighting with and next to you. Put together something with pictures or other mementos (like a binder, picture arrangement, etc) to help facilitate the grieving process . Put on a ruck sack or equivalent and hump 12 miles- even with some tears, you will begin to feel better. Also, surround yourself with people.
I'm not trying to sound flippant or disrespectful. I am also very sorry for your loss.
If you haven't returned to a more functional baseline in about 6-weeks, consider talking with someone. This is an artificial timeline and I'm not suggesting the grief will magically subside. It's merely a concrete end point to evaluate how you can best help yourself. It will get better.