its pretty much impossible to lose fat while in a caloric surplus, so you have to try to build muscle in a caloric deficit. To a newbie who hasn’t seriously trained ever, this should be doable as your body will adapt to the new training stimulus by adding muscle.
Eat at or slightly (500) below maintenance calories, with as much as half of those calories coming during and after your workouts. Also only eat carbs during and after your workouts; make every other meal protein and healthy fats.
For instance, say your maintenance was 3000 cals:
10 minute prior to training start sipping on a serving of Surge (50g carbs, 25g whey). Drink this throughout your workout, then when you get done slam another serving of Surge. An hour later, eat a ~700 cal meal of protein and carbs. Thats 1400 cals around your training. split the other 1500 cals you get for the day into 4-5 meals, and eat those throughout the day.
Honestly though, this works best because your body is rapidly adapting to this new training stimulus. You’ll make gains, but not as great of gains as if you’d just trained hard and ate big. So yes, losing fat and gaining muscle is possible to a newcomer, but ask yourself: is that really how you want to use your newbie gains?