We learn best by doing, and that can be through either joyful or painful experiences. Both have their merits, although the former is of course a whole lot more pleasant than the latter.
Eating my way through Europe as a child I experienced food as exciting - that each meal is a discovery, and that the best times can be had while sitting around a table, tasting, chatting, musing, and discussing. First I learned by watching my parents - shopping, cooking (my mom more than my dad), baking (my dad more than my mom), putting menus together (my mom), selecting wines (my dad), and entertaining (both together). As a teenager I began to cook and bake on my own. Later I became interested in finding out where my food came from - in what soil it was grown, how it was raised or in what waters it swam, with what care, or lack thereof, it was prepared, and the French notion of terroir (here a post on that). In more recent years I have come to realize that food can heal you (let food be thy medicine, an earlier post), but also make you sick. Food is one of the most important aspects of my life because it nourishes both the cells of my physical body as well as my soul.
My positive experiences around food have informed my life enormously and food is one of my favorite forms of pastime and entertainment. From dysfunctional food experiences, on the other hand, you learn "how not to," which in turn can motivate you to find out "how to." Perhaps you experienced food as a reward system. "No dessert until you finish what's on your plate," teaches that dessert is the best part, and to want that the most (hint, hint - sugar craving). Perhaps you experienced food as a substitute for something else. The quintessential American movie scene of drowning your sorrows in a tub of ice cream, alone in front of the television, shows the displacement of the need for love and connection to something sweet (more sugar cravings here). The same goes for comfort foods, which also fill a need other than hunger. Maybe there wasn't enough food to go around when you were younger, and the experience of lack caused you to overeat later on and wanting more than enough. Casually dropped parent comments on clothing and food, especially towards girls, and reinforced by the advertising industry, have twisted girls' body images for decades. This in turn created an obsessive dieting culture and produced guilt feelings around food. "That'll make me fat." A lot of misinformation around cholesterol, fat, sugar, dairy, meat, eggs, and salt, much of it deliberately spread over the past half century, has caused an enormous amount of confusion around what is healthy and what is not.
Once you are aware of how your beliefs around food play out in your life you can begin to dig deeper. The healing process begins by replacing the false or dysfunctional beliefs with positive ones one by one so that those eventually crowd out the counterproductive ones. Let the food joy begin!