Order by your main goal
Whatever you do first gets your best energy. Muscle and strength focused lifters put weights first; if a 5k time is your real goal, run first and lift after.
Lift first if strength or muscle is the goal, so hard cardio does not pre-fatigue your legs and cut your working sets.
If your priority is strength or muscle, lift first. Hard cardio before lifting drains your legs and lowers the weight you can move, especially on squats and deadlifts. Do your cardio after, or on a separate day. A short 5 to 10 minute easy warm up on a bike before lifting is fine, that is not the fatiguing kind of cardio.
Whatever you do first gets your best energy. Muscle and strength focused lifters put weights first; if a 5k time is your real goal, run first and lift after.
Long or intense cardio right before legs blunts squat and deadlift performance and can slightly reduce strength gains over time. Separating them by a few hours or a day minimizes this.
A light 5 to 10 minute cycle to raise your temperature helps. That is different from a hard 30 minute run that leaves your legs cooked before your first working set.
Lift first if strength or muscle is the goal, so hard cardio does not pre-fatigue your legs and cut your working sets.