“Well, then. I’m going to die, aren’t I?” my friend asked me from a bed in the emergency room. I faced him and his wife. I had worked with Alan Davidson for 20 years. A recently retired ER attending physician, he came in with new right-sided numbness one Saturday evening.

Initially, the ER team called a “code stroke,” rushing to take advantage of the precious minutes available to administer clot-busting drugs or open blocked arteries before the patient suffers more brain damage. A CT scan suggested not a stroke but a brain tumor. I was consulted when an MRI suggested a glioblastoma. We both knew his prognosis was likely poor.

Three days later, I took him to surgery, aware that he was trusting me with his life. When he awoke, Alan and I were pleased that his numbness was no worse and he had no weakness. The postoperative scan showed we had removed virtually the entire tumor.

When the pathology came back, I met with Alan, his wife, and his son. I sat on the edge of his bed and told him his diagnosis. Pathology suggested glioblastoma, a malignant brain tumor with a terrible life expectancy. Neither of us was surprised: We both knew this was coming. But he choked up as he expressed gratitude for the care he was receiving.

Holding back my own tears, I told him how honored I felt he trusted me enough to care for him. Previously, I would not have allowed myself to acknowledge my own gratitude to Alan or accept the depths of his gratitude to me: I would have pushed these feelings away.

More than 25 years earlier, I had faced a similar situation with different results. As a resident, I helped my supervising doctor remove a tumor from deep within the temporal lobe of a man in his 30s. The surgery went well, but we knew the patient’s prognosis was dismal. I entered the cramped consultation room and encountered, for the first time, his wife and three small children. They nervously awaited our report.

I couldn’t bring myself to tell them this was an incurable tumor from which the patient would die in the near future. Instead, I parsed my words. They were technically correct, yet detached. Overwhelmed, I had no idea how to face the patient’s family. What they needed was honesty and compassion. Instead, I avoided connecting, leaving someone else to fill in the gaps. To this day, I carry a sense of shame and failure: I avoided pain, but fell short as a physician.

Physicians develop detachment and emotional distance as a coping mechanism against the pain of grief, loss and failure. Yet our attempts to protect ourselves through detachment ultimately intensify feelings of loss and deprive us of resolution. I have come to see that these unresolved feelings contribute directly to professional burnout.

Mary Buss, director of ambulatory palliative care at Beth Israel Deaconess Medical Center and associate professor of medicine at Harvard Medical School, says that physicians are afraid of, and avoid, feelings of sadness. We reason, mistakenly, that being open to pain and loss could damage us; we fear losing our composure and appearing vulnerable. Yet accepting vulnerability is what most closely connects us with our patients. This is what they remember in the end, after all. Patients crave acceptance, appreciation, and acknowledgment; we all want this for ourselves.

As the brother of a patient, I discovered how it felt to be on the receiving end of care lacking in compassion as I observed occasional blunt, insensitive or confusing comments from the medical staff. I became determined to connect more deeply with my patients and my own emotions. Yet I wondered: How could I balance connection and detachment as a neurosurgeon? Did connecting emotionally with my patients mean I could no longer detach enough to be an effective surgeon? Would it be better to become a technician and leave the emotions to others?

I found my approach through a conversation with Helen Riess, a psychiatrist and author of “The Empathy Effect: Seven Neuroscience-Based Keys for Transforming the Way We Live, Love, Work, and Connect Across Differences,” who explained that through the process of developing self- and other empathy, emotional armor could be replaced by “emotional agility.” Intrigued, I went on to read Susan David’s “Emotional Agility: Get Unstuck, Embrace Change, and Thrive in Work and Life,” which characterizes this healthier stance.

Emotional agility enables us to move easily between powerful emotions, recognizing feelings without becoming bogged down by them; to move fluidly through life’s demands without becoming stuck or overwhelmed.

Emotionally agile people derive power from facing, not avoiding, difficult emotions. By allowing ourselves to be vulnerable, physicians become better able to connect more deeply with our patients and ourselves. I came to appreciate that it is possible to move between dispassionate technical precision and intense emotional connection without having to choose between them.

I sat with Alan and his family after his surgery, and we talked until I had to return to the operating room for another case. As I left, Alan remarked that I seemed to get energy and joy from my work. I was surprised to realize that I did feel energized, not depleted; privileged to witness both the beauty and fragility of life. At that moment, I knew I had discarded my suit of emotional armor. In its place was something better and more powerful: emotional agility.

Weeks later, Alan was readmitted to the hospital with increasing right-sided numbness. I read him a draft of this essay as he sat in his hospital bed, unable to control his computer or phone yet intellectually forceful and emotionally attuned. He said that he wanted me to tell his story. He felt strongly this message must be shared, agreeing that doctors often carry a burden of private grief and perceived failures.

We spoke of his children, his grandchildren, his wife. He told me of professional mistakes and a sense of failure that haunted him, yet he also spoke proudly of the thousands of patients he had cared for, their individual stories and faces no longer distinct but flowing through him.

Sitting at my friend’s bedside, I saw Alan forgive himself. He always tried to do his best.

Sometimes, he failed. Just as I often felt powerless, unable to pull someone from the wreckage I saw coming, yet I had done my best. As a resident years ago, knowing that a young husband would not live for long and that his children would lose their father, I had done all I could do — except to allow the enormity of this loss to wash over me, to share it with his family and to accept it, as Alan was doing in his own life.

Alan reinforced for me that it is possible to be a skilled surgeon and also a caring and emotionally connected doctor; to hold someone’s hand, and to be present. I couldn’t repair my failed conversation with that family, but I can learn from my mistakes. As long as I continue to practice, there will be another opportunity to try to get things right.

And, as Alan told me, these lessons hold for our lives beyond practice. Part of emotional agility is self-compassion, often a sticking point for physicians. We tend to be unforgiving of ourselves (and of our colleagues). Just as we need to recognize and admit our failings, we also need to let them go. We must forgive ourselves and each other.

These are essential steps toward accepting our vulnerability and achieving emotional agility. Only then can we abandon our detached and defended selves and make the connections that sustain and enrich us.

Alan Davidson, born Jan. 6, 1942, died June 26, 2020. Joseph Stern is a neurosurgeon in Greensboro, N.C. He is the author of “Grief Connects Us: A Neurosurgeon’s Lessons on Love, Loss, and Compassion,” published in May by Central Recovery Press. His website is josephsternmd.com.