So many of our anxieties around diet take the form of a search for the perfect food, the one that will cure all our ills. Eat this! Don’t eat that! We obsess about the properties of various ingredients: the protein, the omega oils, the vitamins. But nutrients only count when a person picks up food and eats it. How we eat – how we approach food – is what really matters. If we are going to change our diets, we first have to relearn the art of eating, which is a question of psychology as much as nutrition. We have to find a way to want to eat what’s good for us.

Our tastes follow us around like a comforting shadow. They seem to tell us who we are. Maybe this is why we act as if our core attitudes to eating are set in stone. We make frequent attempts – more or less half-hearted – to change what we eat, but almost no effort to change how we feel about food: how well we deal with hunger, how strongly attached we are to sugar, our emotions on being served a small portion. We try to eat more vegetables, but we do not try to make ourselves enjoy vegetables more, maybe because there’s a near-universal conviction that it is not possible to learn new tastes and shed old ones. Yet nothing could be further from the truth.

All the foods that you regularly eat are ones that you learned to eat. Everyone starts life drinking milk. After that, it’s all up for grabs. From our first year of life, human tastes are astonishingly diverse. But we haven’t paid anything like enough attention to another consequence of being omnivores, which is that eating is not something we are born instinctively knowing how to do. It is something we learn. A parent feeding a baby is training them how food should taste. At the most basic level, we have to learn what is food and what is poison. We have to learn how to satisfy our hunger and also when to stop eating. Out of all the choices available to us as omnivores, we have to figure out which foods are likable, which are lovable and which are disgusting. From these preferences, we create our own pattern of eating, as distinctive as a signature.

In today’s food culture, many people seem to have acquired uncannily homogenous tastes. In 2010, two consumer scientists argued that the taste preferences of childhood provided a new way of thinking about the causes of obesity. They noted a “self-perpetuating cycle”: food companies push foods high in sugar, fat and salt, which means that children learn to like them, and so the companies invent ever more of these foods “that contribute to unhealthy eating habits”. The main influence on a child’s palate may no longer be a parent but a series of food manufacturers whose products – despite their illusion of infinite choice – deliver a monotonous flavour hit, quite unlike the more varied flavours of traditional cuisine. The danger of growing up surrounded by endless sweet and salty industrial concoctions is not that we are innately incapable of resisting them but that the more frequently we eat them, especially in childhood, the more they train us to expect all food to taste this way.

Once you recognise the simple fact that food preferences are learned, many of the ways we approach eating start to look a little weird. To take a small example, consider the parents who go to great lengths to “hide” vegetables in children’s meals. Is broccoli really so terrible that it must be concealed from innocent minds? Whole cookbooks have been devoted to this arcane pursuit. It starts with the notion that children have an innate resistance to vegetables, and will only swallow them unawares, blitzed into pasta sauce or baked into sweet treats; they could never learn to love courgette for its own sake. We think we are being clever when we smuggle some beetroot into a cake. Ha! Tricked you into eating root vegetables! But since the child is not conscious that they are consuming beetroot, the main upshot is to entrench their liking for cake. A far cleverer thing would be to help children learn to become adults who choose vegetables consciously, of their own accord.

* * *

By failing to see that eating habits are learned, we misunderstand the nature of our current diet predicament. As we are often reminded, eating has taken a dramatic collective wrong turn in recent decades. Around two-thirds of the population in rich countries are either overweight or obese; and the rest of the world is fast catching up. The moral usually drawn from these statistics is that we are powerless to resist the sugary, salty, fatty foods that the food industry promotes. But there’s something else going on here, which usually gets missed. Not everyone is equally susceptible to the dysfunction of our food supply. Some people manage to eat sugary, salty, fatty foods in modest quantities, and then stop. It’s in all our interests to find out how they have done it.

Facebook Twitter Pinterest ‘Cooking skills are no guarantee of health if your inclinations are for twice-fried chicken, Neapolitan rum babas and French aligot.’ Photograph: Alamy

Many campaigners would say cooking is the answer. If only children could be taught how to cook and plant vegetable gardens, they would automatically become healthier. It sounds convincing: school gardens are a lovely thing. But by themselves, they are not enough to make a child relate to food in healthy ways. Our difficulty is not just that we haven’t learned to cook and grow food, however important that is: it’s that we haven’t learned to eat in ways that support health and happiness. Traditional cuisines across the world were founded on a strong sense of balance, with norms about which foods go together, and how much one should eat at different times of day. Much cooking now, however, is nothing like this. In my experience as a food journalist, chefs and food writers tend to be prone to compulsive eating and other disordered food obsessions. For cooking to become the solution to our diet crisis, we first have to learn how to adjust our responses to food. Cooking skills are no guarantee of health if your inclinations are for twice-fried chicken, Neapolitan rum babas and French aligot: potatoes mashed with a tonne of cheese.

Like children, most of us eat what we like and we only like what we know. Never before have whole populations learned (or mislearned) to eat in societies where calorie-dense food was so abundant. Nor is overeating the only problem that plagues modern affluent civilisations. Statistics suggest that around 0.3% of young women are anorexic and another 1% are bulimic, with rising numbers of men joining them. What statistics are not particularly effective at telling us is how many others – whether overweight or underweight – are in a perpetual state of anxiety about what they consume, living in fear of carbs or fat grams and unable to derive straightforward enjoyment from meals. A 2003 study of 2,200 American college students suggested that weight concern is very common: 43% of its sample group were worried about their weight most of the time (across both sexes) and 29% of the women described themselves as “obsessively preoccupied” with weight.

The question of how we learn to eat – both individually and collectively – is the key to how food, for so many people, has gone so badly wrong. The greatest public health problem of modern times is how to persuade people to make better food choices. But we have been looking for answers in the wrong places.

The way we eat is not a question of worthiness but of routine and preference, built over a lifespan

David L Katz of the Yale-Griffin Prevention Research Center is a rare voice of sanity in the clamorous world of nutrition. He disputes the commonly held view that the reason we don’t eat better is because there is so much confusion over what the “best diet” really is. The medical evidence suggests that it doesn’t matter whether we reach this point via a low-fat route or a low-carb one (or vegan or paleo or just good old-fashioned home cooking). “Our problem,” notes Katz, “is not want of knowledge about the basic care and feeding of Homo Sapiens. Our problem is a stunning and tragically costly cultural reluctance – to swallow it.”

Take vegetables. The advice to eat more vegetables for health could hardly have been clearer. We have been given the message many times, in many forms. Many people, however, have absorbed the lesson from childhood that vegetables and pleasure – and more generally, healthy food and pleasure – can never go together. Consumer scientists have found that when a new product is described as “healthy”, it is far less likely to be a success than if it is described as “new”.

When it comes to our dining habits, there is a giant mismatch between thought and deed; between knowledge and behaviour. “Eat food. Not too much. Mostly plants,” says the influential food writer Michael Pollan. A wise and simple mantra, much repeated; yet for many it seems anything but simple to follow in daily life. A tone of judgmental impatience often creeps into discussions of obesity, from some of those lucky ones who have never struggled to change their eating, along with the quip that all that needs to be done to fix the situation is to “eat less and move more”. The implication is that those who do not eat less and move more are somehow lacking in moral fibre or brains. However, the way we eat is not a question of worthiness but of routine and preference, built over a lifespan. As the philosopher Caspar Hare has said: “It is not so easy to acquire or drop preferences, at will.”

* * *

Once we accept that eating is a learned behaviour, we see that the challenge is not to grasp information but to learn new habits. Governments keep trying to fix the obesity crisis with well-intentioned recommendations. But advice alone never taught a child to eat better (“I strongly advise you to finish that cabbage and follow it with a glass of milk!”), so it’s strange that we think it will work on adults. The way you teach a child to eat well is through example, enthusiasm and patient exposure to good food. And when that fails, you lie. In Hungary, children are taught to enjoy eating carrots by being told that they bestow the ability to whistle. The point is that before you can become a carrot eater, the carrots have to be desirable.

Many of the joys and pitfalls of children’s eating are still there for adults. As grown-ups, we may still reward ourselves with treats, just as our parents did, and continue to “clean our plates”, though they are no longer there to watch us. We still avoid what disgusts us, though we probably know better than to throw it under the table when no one is looking.

Facebook Twitter Pinterest ‘In the wild we would have needed a way to distinguish wholesome sweet fruits from bad bitter toxins.’ Photograph: Mark Bolton/Corbis

There is a common assumption – shared, curiously enough, by those who are struggling to eat healthily and many of the nutritionists who are trying to get them to eat better – that we are doomed by our biology to be hooked on junk food. The usual story goes something like this: our brains evolved over thousands of years to seek out sweetness, because in the wild we would have needed a way to distinguish wholesome sweet fruits from bad bitter toxins. In today’s world, where sugary food is abundant, or so the thinking goes, our biology makes us powerless to turn down these “irresistible” foods. Nutritionists use the word “palatable” to describe foods high in sugar, salt and fat, as if it were impossible to prefer a platter of crunchy greens dressed with tahini sauce to a family-sized bar of chocolate. Yet around a third of the population manages to navigate the modern food world just fine and select a balanced diet for themselves from what’s available.

There are those who can eat an ice-cream cone on a hot day without needing to punish themselves for being “naughty”; who automatically refuse a sandwich because it isn’t lunchtime yet; who usually eat when they are hungry and stop when they are full; who feel that an evening meal without vegetables isn’t really a meal. These individuals have learned the eating skills that can protect them in this environment of plenty.

Viewed through the lens of behavioural psychology, eating is a classic form of learned behaviour. There is a stimulus – an apple tart, let’s say, glazed with apricot jam. And there is a response – your appetite for it. Finally, there is reinforcement – the sensory pleasure and feeling of fullness that eating the tart gives you. This reinforcement encourages you to seek out more apple tarts whenever you have the chance and – depending on just how great you feel after eating them – to choose them over other foods in the future. In lab conditions, rats can be trained to prefer a less sweet diet over a sweeter one when it is packed with more energy and therefore leaves them more satisfied: this is called post-ingestive conditioning.

We know that a lot of this food-seeking learning is driven by dopamine, a neurotransmitter connected with motivation. This is a hormone that is stimulated in the brain when your body does something rewarding, such as eating, kissing or sipping brandy. Dopamine is one of the chemical signals that passes information between neurons to tell your brain that you are having fun. Dopamine release is one of the mechanisms that “stamps in” our flavour preferences and turns them into habits.

In our lives, the stimulus-response behaviour around food is as infinitely complex as the social world in which we learn to eat. It has been calculated that by the time we reach our 18th birthday, we will have had 33,000 learning experiences with food (based on five meals or snacks a day). Human behaviour is not just a clear-cut matter of cue and consequence, because human beings are not passive objects, but deeply social beings. We do not just learn from the foods we put in our own mouths, but from what we see others eat, whether in our own families, at school or on TV.

As children watch and learn, they pick up many things about food besides how it will taste. A rodent can press a lever to get a sweet reward, but it takes an animal as strange and twisted as a human being to inject such emotions as guilt and shame into the business of eating. Before we take our first bite of a certain food, we may have rehearsed eating it in our minds many times. Our cues about when to eat and what to eat and how much to eat extend beyond such drives as hunger and hormones into the territory of ritual (eggs for breakfast), culture (pies at a football match) and religion (turkey at Christmas, lamb at Eid).

The burden of religious guilt lifted from our private lives has become ever more intense in the realm of eating

Our modern food environment is fraught with contradictions. The burden of religious guilt that has been progressively lifted from our private lives has become ever more intense in the realm of eating. Like hypocritical temperance preachers, we demonise many of the things we consume most avidly, leaving us at odds with our own appetites. Numerous foods that were once reserved for celebrations – from meat to sweets – have become everyday commodities, meaning not only that we overconsume them but that they have lost much of their former sense of festive joy. The idea that you don’t eat between meals now seems as outdated as thinking you must wear a hat when you step out of the house.

* * *

In many ways, children are powerless at the table. They cannot control what is put in front of them, where they sit, or whether they are spoken to kindly or harshly as they eat. Their one great power is the ability to reject or accept. One of the biggest things many children learn at that table is that their choice to eat or not eat unleashes deep emotions in the grown‑ups close to them. They find that they can please their parents or drive them to rage, just by refusing dessert. (And then the adults complain that they are difficult at mealtimes.)

After a certain point in our lives, we discover the glorious liberation of being able to choose whatever we want to eat – budget permitting. But our tastes and our food choices are still formed by those early childhood experiences. Rather alarmingly, it seems that our food habits when we were two – whether we played with our food, how picky we were, the amount of fruit we ate – are a pretty accurate gauge of how we will eat when we are 20.

The acquisition of eating habits is a far more mysterious skill than other things we learn in childhood, such as tying our shoelaces, counting or riding a bike. We learn how to eat largely without noticing that this is what we are doing. Equally, we don’t always notice when we have learned ways of eating that are dysfunctional, because they become such a familiar part of ourselves. Having particular tastes is one of the ways that we signal to other people that we are unusual and special. We become known as the person in the family who adores munching on bitter lemon rind or the one who eats apples right down to the pips.

Facebook Twitter Pinterest ‘In the 1970s it was a common rite of passage to reject the conventional bland watery foods of a 1950s childhood and embrace mung beans and spice.’ Photograph: B Borrell Casals/Frank Lane Picture Agency/Corbis

You might say that food dislikes do not matter much: each to their own. I won’t give you a hard time for hating the fuzzy skin of peaches if you will excuse my squeamishness about the gooey whites of soft-boiled eggs. The danger is when you grow up disliking entire food groups, leaving you unable to get the nutrition you need from your diet. Doctors working at the front line of child obesity say it has become common in the past couple of decades for many toddlers to eat no fruit and vegetables at all. This is one of the reasons constipation is now such a huge – though little mentioned – problem in western countries, giving rise to 2.5m doctor visits a year in the US.

The first step to eating better is to recognise that our tastes and habits are not fixed but changeable

Some hold the view that it doesn’t really matter if children have unhealthy tastes, because once they grow up they will effortlessly acquire a penchant for salad, along with a deeper voice and mature political opinions. Sometimes it does work out this way. In the 1970s it was a common rite of passage to reject the conventional bland watery foods of a 1950s childhood and embrace mung beans and spice. Many tastes – for green tea, say, or vodka – are acquired, if at all, in adulthood. When we learn to love these bitter substances, we undergo what psychologists call a “hedonic shift” from pain to pleasure. You may overcome your childish revulsion at the bitterness of espresso when you discover the wonderful after-effects, how it wakes up your whole body and infuses you with a desire for work. The great question is what it takes for us to undergo a similar hedonic shift to enjoying a moderate diet of healthy food. The process will be different for each of us, because all of us have learned our own particular way of eating, but wherever you start, the first step to eating better is to recognise that our tastes and habits are not fixed but changeable.

Poverty makes eating a healthy diet harder in numerous ways. It’s not just because it is far more expensive, gram for gram, to buy fresh vegetables than it is to buy heavily processed carbohydrates. Maybe you live in a “food desert” where nutritious ingredients are hard to come by; or in housing without an adequate kitchen. Growing up poor can engender a lifetime of unhealthy food habits, even if your income later rises. When the flavour of white bread and processed meat are linked in your memory with the warmth and authority of a parent and the camaraderie of siblings, it can feel like a betrayal to stop eating them.

Yet it’s striking that some children from low-income households eat much better than others, and sometimes better than children from more affluent families. The problems with how we eat now cut across boundaries of class and income. It is feasible to create decent, wholesome meals – bean goulash, spaghetti puttanesca – on a shoestring budget. Equally, one can have the funds to buy chanterelle mushrooms and turbot but no inclination to do so. According to feeding therapists with whom I have spoken, there are successful businesspeople who will – literally – pass out from hunger at their desks rather than allow an unfamiliar meal to pass their lips when their preferred junk food is not available. Assuming that you are not living in a state of famine, the greatest determinant of how well you eat is the way you have learned to behave around food.

This behaviour is often immensely complex. In 1998 the social psychologist Roy Baumeister did a famous experiment. Baumeister, who is known for his work on self-defeating behaviours, found that the struggle of will required when a group of people were asked to eat “virtuous” foods such as radishes instead of the foods that they really wanted, such as chocolate and cookies, led to diminishing returns. They were so depleted by the effort of the task that when faced with another difficult task – solving a tricky puzzle – they would give up more quickly. The emotional effort of not eating the cookies had a “psychic cost”.

* * *

Changing food habits is one of the hardest things anyone can do, because the impulses governing our preferences are often hidden, even from ourselves. And yet adjusting what you eat is entirely possible. We do it all the time. Were this not the case, the food companies who launch new products each year would be wasting their money. After the fall of the Berlin Wall, housewives from East and West Germany tried each other’s food products for the first time in decades. It didn’t take long for those from the east to realise that they preferred western yoghurt to their own. Equally, those from the west discovered a liking for the honey and vanilla wafer biscuits of the east.

Facebook Twitter Pinterest ‘You see the greasy burger and you no longer think it has much to say to you.’ Photograph: Cadalpe/Getty Images/Image Source

Even though most of us have tastes acquired very young, we can still change. EP Köster, a behavioural psychologist who has spent decades studying why we make the food choices we do, says that food habits “can almost exclusively be changed by relearning through experience”. That is, if we want to relearn how to eat, we need to become like children again. Bad food habits can only change by making “healthy food” something that is pleasure-giving. If we experience healthy food as a coercion – as something requiring willpower – it can never taste delicious.

It’s seldom easy to change habits, particularly those so bound up with memories of family and childhood, but, whatever our age, it looks as if eating well is a surprisingly teachable skill. This is not to say that everyone should end up with the same tastes. But there are certain broad aspects of eating that can be learned and then tailored to your own specific passions and needs. There are three big things we would all benefit from learning to do: to follow structured mealtimes; to respond to our own internal cues for hunger and fullness, rather than relying on external cues such as portion size; and to make ourselves open to trying a variety of foods. All these three can be taught to children, which suggests that adults could learn them too.

For our diets to change, as well as educating ourselves about nutrition – and yes, teaching ourselves to cook – we need to relearn the food experiences that first shaped us. The change doesn’t happen through rational argument. It is a form of reconditioning, meal by meal. You get to the point where not eating when you are not hungry – most of the time – is so instinctive and habitual it would feel odd to behave differently. Governments could do a great deal more to help us modify our eating habits. In place of all that advice, they could reshape the food environment in ways that would help us to learn better habits of our own accord. A few decades from now, the current laissez-faire attitudes to sugar – now present in 80% of supermarket foods – may seem as reckless and strange as permitting cars without seatbelts or smoking on aeroplanes. Given that our food choices are strongly determined by what’s readily available, regulating the sale of unhealthy food would automatically make many people eat differently. Banishing fast-food outlets from hospitals and the streets surrounding schools would be a start. One study shows that you can reduce chocolate consumption almost to zero in a student cafeteria by requiring people to line up for it separately from their main course.

But at an individual level, we won’t achieve much by waiting for a world where chocolate is scarce. Having a healthy relationship with food can act like a lifejacket, protecting you from the worst excesses of the obesogenic world we now inhabit. You see the greasy burger and you no longer think it has much to say to you. This is not about being thin. It’s about reaching a state where food is something that nourishes and makes us happy rather than sickening or tormenting us. It’s about feeding ourselves as a good parent would: with love, with variety, but also with limits. Changing the way you eat is far from simple, but nor, crucially, is it impossible. After all, as omnivores, we were not born knowing what to eat. We all had to learn it, every one of us, as children sitting expectantly, waiting to be fed.

First Bite by Bee Wilson (Fourth Estate, £12.99). To order a copy for £9.99, go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.