Every time I talk about cardio I cringe at myself for how I approached cardio back in the day.
For those that don't know, I originally got into fitness by running. I injured myself (because I didn't know what I was doing and certainly wasn't strength training to minimize opportunities of injury). Once I learned about strength training and discovered I could achieve my goals without doing cardio (because of my food consumption, although at the time I believed it was due to my training), I stopped doing cardio. I would run a short bit every few weeks or hop on the stair stepper every now and then, but certainly didn't program it or keep track of it. All that to say, cardio and strength are equally important parts of overall health and well-being.
So, when is the best time to do cardio?
Have you gotten used to this response from me when I refer to anything that's "best"? I know, I'm becoming too predictable.
It truly depends on your goals.
If you're in a strength phase right now and your goal is to gain strength or if you're in a hypertrophy phase and your goal is to build muscle, I would suggest performing your lifting and cardio sessions on separate days if at all possible. If it's not possible, complete your lift first, then do your cardio. I'd rather you tax your muscles on your lift first, if you want to gain strength or build muscle. When it comes to cardio training during strength and hypertrophy phases, the intensity and frequency of the cardio is often less than when in an endurance phase. You're likely sticking around Zone's 2-3 to maintain cardio. You may have intervals scheduled, as well, to keep up with cardio capacity. Overall, the goals during strength and hypertrophy phases are less cardio-focused, therefore prioritizing your lifts makes more sense.
Remember, don't be like 2016 Katharine and omit cardio all together. Your cardio health is just as important as your strength. Just because a phase focuses more on lifting does not mean we stop doing cardio all together. Cardio is part of having a well-rounded program.
If you're in an endurance or power phase, I would still suggest doing your lifting and cardio sessions on separate days if at all possible. If it's not possible, complete your cardio first, then do your lift. For example, if you're training for a trail 10K, your main focus of your program is running. Allow the bulk of your energy to be put toward your run, then lift afterwards, as your lifts are likely in maintenance-ish mode during this season anyway.
In an ideal world where you have all the time to spare, if you have to complete your lift and cardio on the same day, try to separate them out by 4-8 hours. Although, not many people have the time or flexibility to not only workout at two separate times of day, but also shower twice a day?!
Ultimately, if these options aren't fit for your goals, that's okay. Getting it done whenever possible is also a valid answer. I'd rather you do your lift and cardio when you can than only do one or the other or neither at all.
The best time to do cardio is when you can get it done and consistently do it.