Whether hitting the gym on an empty stomach will help you lose weight faster has always been a controversial question. Like much other fitness advice, this falls into the grey area of 'it depends'. Let's see why.
You may have heard the idea that you may burn more fat when you squeeze in a morning cardio session before you even think about breakfast.
What happens is that glycogen, a stored carbohydrate, runs out during your sleep overnight. When you wake up, because your body is low on carbohydrates, its preferred source of energy, it turns to burning stored fat to gain energy.
If you were to do low- to moderate-intensity exercise first thing in the morning, glycogen will still be in your body to fuel it, and its reduced percentage will help your body prioritize fat and it will be oxidized (burned) at a faster rate.
But if you are doing a high-intensity workout, it is particularity important to eat before a workout to give your body the fuel it needs to power through your exercise. Otherwise, your body will turn to breaking down muscle to use protein as fuel. This is something you do not want, as muscles is what gives shape and definition. When this happens, you lose muscle mass, your performance will suffer and you will no longer be able to continue working out at that intensity.
So here is the answer: if you just aim to lose fat, your priority is fat oxidation, so you want to do fasted cardio. But if you want to lose fat and preserve muscle, you should fuel up beforehand.