Easy, find out how many calories you burn a day with no activity. Start with 12cals/lb bodyweight if you don't know. Next consume that amount of calories with a gram of protein per pound of bodyweight as a minimum to preserve muscle mass while losing fat. Consume enough carbs to get you through your workouts and the rest in quality fats.
I went at this in the reverse. Aim for .3–.5g/lb bodyweight of fats, and get the rest of your calories from good carbs. So for a 200lb guy, that 200g protein, 60–100g fats, and assuming you need 2400 cals/day, 165–265g from carbs.
There is a top 20 list on the Internet somewhere on the highest quality foods to consume, pick your food sources from that list.
Don’t cut calories because you will decrease nutrients, but increase exercise to burn fat.
I think most guys say you can cut cals by up to 500/day without risking health or losing muscle.
Example; If you want to lose 1 pound of BF a week than do 500 calories of exercise a day. If you want to lose 2 pounds a week of BF than do 1000 calories a day of exercise.
If you stop working out all-together you will not gain the weigh you lost back because what you consume and what you burn are equal.
I’ve been going for about 9 months now on this pattern and have lost 50 pounds with no problem keeping it off. Diet fads don’t work for most of us in the long run, you have to change your eating lifestyle until the box goes in the ground.