Calculate calorie needs: First get your BMR (Basal Metabolic Rate), then multiply by an activity factor to get your TDEE (Total Daily Energy Expenditure).
BMR= 370 + (21.6 x LBM (Lean Body Mass), Where LBM = [Total Weight (KG) x (100 - Body Fat %)] /100
Next take that number and use an activity factor to get TDEE (more active, use a higher number and lower number for less active) but remember this accounts for all activity and not just exercise (busy job/active life, choose a higher value)-
1.2- Sedentary (desk job and little exercise/activity)
1.3-1.4- Lightly Active Light daily activity, light exercise 1-3 times per week)
1.5-1.6- Moderately Active (Moderately active, moderate exercise 3-5 times per week)
1.7-1.8- Very Active (Physically demanding lifestyle, hard exercise 5-7 times per week)
1.9-2.2- Extremely Active (Endurance athlete, very hard physical job)
Now that you have the TDEE, get your macro-nutrient needs (fat, protein, and carb needs). Fat has 9 calories per gram, and protein/carbs have 4 calories per gram, alcohol is 7 calories per gram count it as a carb when fitting it into your macros).
Protein- .8 grams per pound
Fat- .4 grams per pound
Meet those MINIMUMS and then fill out remaining calories as you want with carbs, or more protein and fat, or any combination. Remember to track properly too, use a food scale (measuring cups can be very inaccurate due to density); track everything, each little bit adds up (sauces can be quite calorie dense).
Next decide your goal and eat at a 10-20% caloric deficit or surplus, deficit to lose weight and surplus to gain. For gaining go for ~.5-1 pound per week and when losing aim for 1-2 pounds per week. Reach your macro needs with mostly whole foods and a wide variety to ensure enough vitamins and mineral, but remember to practice common sense and moderation- enjoy life.