Your body will tell you what it needs in the form of cravings. The trick is to develop an internal "ear" for your body's nutritional signals, while learning to ignore the orders old habits try to give. Most of us have lost or ignored those natural tiny signals long ago because our habits "speak" so much louder. So we need to learn to differentiate between a habit and a craving first, before we can become "intuition eaters."
It's easy. Habits tend to be repeated behaviors; cravings are mostly one-time feelings. Habit foods are usually not so good for you, like candy, desserts, fatty snack foods, fried foods, etc. Craving foods are what you need to satisfy your nutritional needs, to get enough energy and deep physical vigor for living.
Craving foods are usually much better for your health and fall into categories like protein, minerals, vitamins, etc. (I craved spinach today, so I must need iron. Or if I really have a hankering for a cheese sandwich or a hamburger then I probably need more protein.)
If you feel compulsive (that out-of-control and MUST have a specific thing, or piles of food NOW struggle) it means there’s a habit talking.