Step 1: Figure out how many calories you need for your goals. Gain or lose weight.
Step 2: Figure out what macros you need to fit your goals. That's protein/fat/carbs.
Step 3: Adjust for allergies or dietary dogma (vegan, paleo, no dairy etc...)
Step 4: Eat that way for a whole month.
Step 5: Adjust calories/macros based on your results.
Step 6: Repeat forever.