During my first year as a monk, when I was staying at a monastery near Bangkok, we received an invitation from the children of a man in the last stages of liver cancer, asking for some monks to visit their father in the hospital, as he wanted to make merit and hear the dhamma one last time before he died. Five of us went the next morning, and the senior monk in the group chatted with the man for quite a while to put his mind at ease and help him prepare for his coming death. Now was the time, the monk said, for him to put aside all concern for his body and to focus instead on the state of his mind so that it wouldn’t be overcome by pain as his body fell apart.

Suddenly the man blurted out that the worst part of the cancer wasn’t the pain. It was the embarrassment. All his life he had prided himself on staying fit and trim while his friends had gotten fat and paunchy, but now his belly was so horribly bloated from the cancer that he couldn’t bear to look at it or to imagine what other people might think, seeing him like this. No matter how much the senior monk tried to reassure him that it was nothing to be ashamed of—that this was part of the body’s normal nature beyond anyone’s control—the man wouldn’t let go of the conviction that his body had betrayed him and was now an embarrassment in the eyes of the world.

All through the conversation I couldn’t help thinking that the man would have suffered a lot less if he had taken some of the time he had devoted to looking fit and spent it on contemplating the unattractiveness of the body instead. I myself had never felt much enthusiasm for this particular meditation theme—I preferred focusing on the breath, and would contemplate the parts of the body more out of a sense of duty than anything else. But now I saw that the Buddha’s teaching on body contemplation was really an act of kindness, one of the many effective and essential tools he left behind to help alleviate the sufferings of the world.

On the way back to the monastery, I also realized, to my chagrin, that I had been complacent about my attitude toward my own body. Despite my contemplation of my liver, intestines, and everything else under my skin, I still took pride in the fact that I had kept fit when other people my age were getting a little flabby. Although I had consciously resisted the unrealistic standards for looking good fostered by the media, I had felt a little moral superiority about staying in good shape. But now I had to admit that even my “reasonable” amount of pride was dangerous: I, too, was setting myself up for a fall. Eating and exercising to be healthy may generally be a good policy, but a concern for looking healthy can be unhealthy for the mind.

Most of us in the West, of course, don’t see it that way. Because the modern obsession with impossibly perfect body images has taught so many people to hate their bodies to a pathological degree, we’ve come to identify all positive body images as psychologically healthy, and all negative body images as psychologically sick. When we learn of the Buddha’s recommendations for contemplating the body, we see them as aggravating rather than solving the problem. What we need, we think, is a way of meditating that develops positive images of the body as a beautiful and sacred vehicle for expressing compassion and love.

From the Buddha’s perspective, though, this attitude is radically deluded. As a prince he had been no stranger to the obsession of trying to measure up to extravagant standards of beauty. If you read the monastic rules describing the means of beautification denied to monks and nuns—creams, cosmetics, jewelry, red dye for hands and feet—you realize that India was just as obsessed with superhuman ideals of beauty as we are. Through the Buddha’s understanding of how perceptions of the body can function both as aids and hindrances in the quest for liberation, he came to realize that there are four kinds of body images, not just two: healthy positive, unhealthy positive, healthy negative, and unhealthy negative—“healthy” meaning leading to long-term happiness; “unhealthy” leading to long-term suffering and pain.

Related: I Tried the “Buddhist Monk” Diet—And It Worked

When you understand this point, you’ll see that his teachings on the body are aimed at liberating us from unhealthy body images of both sorts and replacing them with both sorts of healthy images. And when you understand the dangers of un-healthy body images—whether positive or negative—along with the freedom that comes from cultivating both sorts of healthy body images, you’ll realize that the Buddha’s training in resetting your body image is both a useful defense against the skewed messages of our culture and a necessary part of the Buddhist path.

Unhealthy body images, whether positive or negative, start with the assumption that the body’s worth is measured by the beauty of its appearance. The damage done by this assumption when it leads to negative body images is common knowledge, but the damage done when it leads to positive images is just as bad, if not worse.

This is because the perception of beauty carries a power. We sense the power wielded by the people we perceive as attractive, and we want to exert the same power ourselves. This is one of the reasons we resist the idea of seeing the body as unattractive, for that would be to deny ourselves a major source of the power we consciously and unconsciously try to wield. We forget, or choose to ignore, the dangers that this kind of power entails.

The desire to use your beauty to exert control over others ends up enslaving you to those you hope to control.

First, it leads to unskillful karma. Because beauty is a quality that invites comparison, it often carries with it a sense of pride and conceit with regard to those you perceive as less attractive than you, along with the kinds of unskillful actions that pride and conceit can so easily engender.

Second, it’s fragile. No matter how hard you try to stave off the signs of aging, they always arrive too soon. The pride that once sustained you now turns around to stab you. Even when the body is at the pinnacle of its health and youth, to perceive it as beautiful requires huge blind spots: that you ignore any external features that are less than beautiful, that you view it only from certain angles and when the lighting is just so—and don’t even think of what lies inside, just under the skin, ready to ooze out of your orifices and pores. Because these unattractive features can show themselves at any time, you need constant reassurance that no one else notices them, and even then you wonder if the people reassuring you are telling you the truth.

When you’re attached to something so fragile, you’re setting yourself up to suffer. The appearance of each new wrinkle becomes a source of fear and anxiety, and when this is the case, how will you not be afraid of aging, illness, and death? And if you can’t overcome this fear, how will you ever be free?

And third, the fragility of this power also enslaves you to others. When you want to look good to others, you’re placing your worth in their hands. This is why people who are self-conscious about their looks resent being the object of someone else’s objectifying gaze. They would prefer that it be an expression of pure admiration, but they know deep down that it often isn’t. Do those who are gazing at you really admire you? What standards are they measuring you against? Even if they do admire you, how pure is the driving force behind their admiration? Is their attention something you really want? Even though you may have cultivated your beauty as a means of power, you can’t control who that power will draw to you, or why.

When you internalize the gaze of others, you’re a prisoner of what, in reality, you’re reading into their gaze—an uncertain process at best. The more you want to believe in your own beauty, the more you become attracted to people who show signs of being attracted to you, but then you find yourself serving their interests rather than your own.

In your quest to develop and maintain your beauty, you also become a slave to the beauty industry in its various forms—an industry that holds out the promise that perpetual beauty is possible but at the same time keeps pushing the ideal of beauty to more and more impossible extremes, requiring more and more of your money and time. These extremes can even compromise our health, as we see in the cult of freakishly thin female models and morbidly muscular men.

This is probably the most ironic aspect of the power of beauty: that the desire to use your beauty to exert control over others ends up enslaving you to those who promise to help you maintain your beauty as well as to those you hope to control.

In contrast to an unhealthy positive body image, a healthy one focuses not on how good the body can look but on the good it can do. As an object of concentration, the body can be a source of rapture and well-being to sustain you on the path. We learn to appreciate the body as a tool for expressing kindness and developing the inner beauty of generosity and virtue—which, as the Buddha noted, are beautiful even through old age (see SN 1.51). With this sort of body image, the appearance of wrinkles is not a threat to the worth of your body but simply a reminder to accelerate our efforts to do good as time is running out.

Most people believe that it’s possible to appreciate the body both because of its potential for beauty and because of its potential for goodness, but an unhealthy positive body image undermines a healthy positive body image because the time and energy spent on shoring up your perception of your own beauty lessens the time and energy you could spend on doing good.

At the same time, the hidden agendas of beauty often confuse and pervert your perception of what “good” really is. This confusion, for instance, is what allows spiritual teachers to claim that sex with their students can be a sacred and healing activity. No one who is free of an unhealthy positive or negative body image would seriously entertain such an idea.

Related: How to Heal After Your Teacher Crosses the Line

The ultimate purpose of this contemplation is to see that the problem doesn’t lie with the body; it lies with your choice of perceptions.

It’s because an unhealthy positive body image works at cross-purposes with a healthy positive image that it needs to be counteracted by a healthy negative image of the body’s beauty. This differs from an unhealthy negative body image in three important respects:

First, an unhealthy negative body image sees an unattractive body as bad. A healthy negative body image sees that physical unattractiveness is simply a perception, as empty as all other perceptions, and irrelevant to the body’s worth or to your own worth as a person.

Second, an unhealthy negative body image comes from seeing your body as unattractive and other people’s as attractive. A healthy negative body image comes from regarding everyone as basically unattractive—like houses in the tropics made of frozen meat. Even if some of them are more nicely shaped than others, when you smell their slow decay in the present and think of what they’ll be like when completely thawed, you’re not attracted to any of them at all.

Third, an unhealthy negative body image is the result of attachment. Hating our appearance doesn’t mean we’re unattached to our bodies. We’re actually fiercely attached both to our bodies and to an ideal of beauty that our bodies have yet to attain. The conflict between these two forms of attachment is what makes us suffer.

What makes a healthy negative body image healthy is that it allows you to see the body’s beauty as a matter of indifference and to regard the body purely as a tool for developing the skillful qualities of the mind.

The Buddha’s strategy for developing a healthy negative body image starts with the mindfulness practice of focusing on the body “in and of itself, putting aside greed and distress with reference to the world” (DN 22). In other words, instead of regarding the body through the internalized gaze of others, you regard it simply as you experience it here and now, on its own terms. A good place to begin is with the experience of the breath, learning how to manipulate that experience so as to induce a feeling of ease and refreshment in your immediate sense of the body. This sense of well-being reaffirms the worth of the body as a source for harmless happiness—when approached skillfully—even as you dismantle your notions of its attractiveness.

There are two traditional ways to start the dismantling: either visualizing what the body would be like if you dissected it into its various parts, or visualizing how it would decompose after death.

For the dissection contemplation, you can start with the canonical list of 31 parts: head hair, body hair, nails, teeth, skin, muscles, tendons, bones, bone marrow, kidneys, heart, liver, pleura, spleen, lungs, large intestines, small intestines, contents of the stomach, feces, bile, phlegm, lymph, blood, sweat, fat, tears, skin-oil, saliva, mucus, fluid in the joints, and urine. Visualize each of these parts until you find one that’s especially disenchanting, and focus on that. Or you can focus on any part not on the list. I, for instance, have found it effective to think of what eyes look like without eyelids.

To get started with the right attitude to this contemplation—serious enough to show you mean business, but lighthearted enough to keep from getting depressed—you can ask yourself as you reach each part: What would you do if you opened a room and unexpectedly found that part on the floor? Or if you sat down at a table and found it on your plate? If it’s liquid, would you want to bathe in a vat of it? Think in these ways until you realize how ridiculous it is to want to look for beauty in a body made of these things.

For the decomposition contemplations, you can first visualize the body aging in ten-year stages, then dying, getting bloated, and drying out until it’s just dust. Then you can reverse the contemplation, bringing the body back to its present state to emphasize the fact that the potential for all those stages is right here, right now. This contemplation helps to remind you that no matter how wisely you care for the body or how artfully you improve its appearance, it will someday reach the point where you wouldn’t want to be near it at all. If you don’t learn how to let go of it now, you’ll have a hard time letting go when death forces the issue.

For these perceptions to be healthy, you have to learn how to apply them equally to everyone. In fact, that’s what these perceptions are meant to be: equalizers. You’re looking at the truths of all bodies, equally, all over the world. Most meditators are encouraged to apply these perceptions to their own bodies before applying them to others—on the grounds that our attraction to others often starts with our attraction to ourselves—but if you suffer from an unhealthy negative body image, start by applying them to a body you envy. Imagine, for instance, that supermodels were required to wear their skin inside out, and that all athletes and entertainers flaunting their abs were required to display everything else their abdomens contain. Only when your sense of humor can shake off your envy should you apply the perceptions of unattractiveness to yourself.

Regardless of what kind of unhealthy body image you start with, this contemplation is sure to get under your skin not only in a literal sense but also in an idiomatic one. It has to, because a part of the mind, well-entrenched for lifetimes, is sure to resist. If you obey the inner voices that put up resistance, you’ll never be able to dig up the unhealthy attitudes hiding behind them. Only when you challenge that resistance will you clearly see the underlying unskillful agendas behind your attachment to bodily beauty. And only when you see them clearly can you work your way free from them.

After all, the ultimate purpose of this contemplation is to see that the problem doesn’t lie with the body; it lies with your choice of perceptions. And it sensitizes you to how those choices are made: When you’ve been developing the perception that the body is unattractive, why does the mind suddenly switch back to the perception that it’s attractive? What are the steps in that shift? When you try to answer these questions through observing the mind in action, you learn a lot about how the mind can fool itself—and how willing it is to be fooled.

Above all, try to bring an attitude of humor to this contemplation, so that you can laugh good-naturedly at your foolishness in looking for beauty in the body. If, at any time, these exercises lead to feelings of disgust or depression, drop them and return your attention to the breath until you’ve induced a sense of inner ease and refreshment. Resume the perceptions of unattractiveness only when you’re in a more balanced state of mind. As one famous Thai meditation teacher said, you’re not aiming at revulsion; you’re simply trying to sober up.

If you’re in a relationship, don’t worry that you’ll ruin it with this meditation. Only after a great deal of time and dedication can these perceptions—and the understanding you gain from them—eradicate sexual desire entirely. In the meantime, you can actually use these perceptions to strengthen your relationship as you apply them to anyone outside the relationship who might tempt you to be unfaithful to your partner. They also help you to focus more attention on the aspects of the relationship that will give it a more substantial basis to last over time.

And don’t be afraid that this meditation will leave you listless and morose. The more you can free yourself from your internalization of the gaze of others, the more liberated you feel. As you bring more humor to issues of the body’s appearance, the more you will unleash the healthy energies of the mind.