In all the years I had known him, through hundreds of therapy hours that sometimes left me feeling as hopeless as he did; he had never stopped talking about killing himself. He had almost succeeded on a number of occasions and we believed him when he said that the only thing keeping him alive was the lack of means and opportunity in the hospital.

Like many people who have abandoned hope, he had lost much. He would say everything and that would be only a slight exaggeration. Alone with his thoughts, he cried almost daily. And yet, he wondered out loud, how is it that I sometimes find myself laughing and, in those moments of relief, not thinking about how to end my life?

As they often do, the boys in the basement delivered my answer, tempered I hope by what I knew about my patient and about psychology. Perhaps your laughter comes from a place in your heart that wants to go on living. Your brain keeps telling you to die but your heart has not forgotten how or why to live. He told me that he finds himself laughing when he is talking with people he likes or when he is playing pool in the recreation center. We agreed to explore the idea that he may be getting false messages from a brain knocked out of balance by mental illness.

If my patient’s persistent thoughts about suicide were true obsessions, then he might learn to manage them by using the four-step bio-behavioral self-treatment for OCD developed by Dr. Jeffrey Schwartz at UCLA. I could teach him first to re-label the thought of killing himself as an obsession that is a symptom of a medical disorder. We could work on developing his capacity to monitor his thoughts, to develop what Schwartz, borrowing the term from economist Adam Smith, called the “Impartial Spectator.” Psychoanalytic ego psychologists call this the observing ego and practitioners of DBT speak of cultivating mindful awareness. Good ideas never die; they just get different names.

Knowing that the thought of killing himself is a symptom and not a rational alternative, my patient could apply step two and re-attribute the thought to the faulty operation of a structure or chemical process in his brain. With true obsessions, the fault lies not in ourselves but in our brains, most likely in the caudate nucleus, a kind of switch that signals a matter is settled and we can stop thinking about it. With his switch stuck in the on position, he has to learn to operate it manually. This is step three with its task of re-focusing on another thought. The best way to do this is to change your behavior and do something different like getting into a conversation or playing a game of pool. With repeated practice over time, my patient might reach step four and come to re-value his thoughts of suicide as false messages from a faulty brain and not as the expression of his innermost desires.

And what of his laughter? Does it really signal the presence of something in him that feels pleasure and might provide the motivation to go on living or is it only a meaningless reflex blown out of proportion by a still hopeful therapist? Whatever else it may be, laughing is fun. Unless we are severely depressed, we like to laugh and will seek out situations and people that make us laugh. It has long been thought that laughing improves our health. The Reader’s Digest magazines that I remember from childhood had a joke section called, Laughter is the Best Medicine, and it was always the first thing I read.

Folk wisdom about the health benefits of laughter was bolstered by the first-person account of journalist Norman Cousins who chronicled his recovery from a serious form of arthritis in his 1981 book, “Anatomy of an Illness.” Cousins attributed his cure to a regimen of massive doses of Vitamin C and a steady diet of Marx brothers’ films. He found the comedies especially effective in controlling pain. In more recent years, claims have been made that laughter also has a positive effect on blood flow, the immune response, blood sugar levels, relaxation and sleep.

To better understand why we laugh, psychologist Robert Provine conducted a large-scale study of naturally occurring laughter involving more than 2,000 cases over a 10-year period. Discussing his results in a 1999 interview, Provine explained that most laughter does not come in response to jokes but occurs in social situations to communicate playful intent. Contagious, preverbal and spontaneous, laughter is a kind of social glue that keeps us connected to one another.

Amidst the clamor of an angry mob of his own thoughts calling for his death, a man notices that he is laughing and wonders why. How much are his thoughts of suicide a reflection of a pervasive self-loathing and how much are they the product of a brain stuck in an obsessional rut through the influence of chemistry and habit? Can he enjoy his laughter and learn to seek out situations where he can laugh with others or must he go on punishing himself for his losses and failures? Like most of the important questions in life, the answer is not a simple one. It lies in a complex dialogue between the head and the heart, a conversation that sometimes starts with a laugh.

Alan Bodnar is a psychologist at the Worcester Recovery Center and Hospital.