It helps most if you get a proper "rest and diet schedule" to stay consistent. In the military, they usually exercise in the morning and it helps start your day, so it's good to get in the habit. If you train later in the day, it can effect sleep and rest. Avoid caffeine, large meals, or showers close to bed time. Practice methods of shutting down your brain almost as a form of sleep meditation to get productive rest. I wasn't always good at this, but it works if you can do it. And it's especially helpful when you'll be inevitably sleep deprived. If you need help waking up, maybe if you don't get a lot of sun where you live, you could try a sun alarm.
Diet and caloric intake is important. And anything you can do to make training easier on yourself, such as doing body resistance training at home, if you aren't in the mood for the gym or playing a fast moving sport like Tennis to reinforce the joints or rock climbing to build up great core, if you need something more fun. Swimming is useful too, especially if you are going into the Navy, you will want to learn how to tread water best and unfortunately the more muscular you are, the harder it is to float. You can practice wearing weights in the water too to simulate any gear you might carry. Make sure to change up your exercises too. Training many muscles, including fast twitch can help with PT scores in general, even with running, to finish faster.
Since you're going officer, you're basically becoming a high performing athlete, so almost all of the same advice applies, and it will hinder your promotions if you don't perform as well as the other officers, unfortunately. And you are expected to perform better than most of the soldiers. And good luck with the crazy politics happening now! Hopefully you don't end up fighting in the Middle East (apparently right now the Navy is defending trade ships from Iranian attacks in the Gulf of Adan) or China Seas because of strange politics! China has been eyeing and planning military exercises around Taiwan for a long time now, unfortunately.