To lean out your body you needs to use your stored fat as fuel for exercise. In order to do this, you must burn off your glycogen stores first. When you weight-train, you typically use glycogen as fuel. By doing weight-training first, you can burn the majority of your glycogen stores. Knocking out your cardio after you crush the weights will burn more fat!
It’s also perfectly fine to vary your workouts by doing resistance-based work one day and cardio on the other. Remember fitness is never a one-size-fits all, try and get in touch with your own body and its needs.
Focus on your goals to help you decide whether to do cardio before or after weights. If you want to improve cardio endurance for instance, then you should do your heart-pumping exercise first while you’re feeling fresh. And if your goal is to build more muscle then weight training first before you exhaust yourself doing cardio.