Four weeks before Oliver Sacks died, I received a letter from him. In our all too brief correspondence, he never e-mailed. He wrote beautiful, longhand letters on heavy, cream-colored stationery with a blue fountain pen, the script slanting to the left. They were always peppered with cross-outs and insertions that gave a glimpse of his overflowing mind.

“I’m writing a piece on EYES—all sorts, from those of jellyfish and scallops and jumping spiders and octopi to our (vertebrate) eyes,” he reported. “I am also trying to write something about the (deadly) effects of ‘social-media’ when they absorb people, to the exclusion of everything else, throughout their waking hours.” He told of his delight in coming upon a century-old E. M. Forster short story called “The Machine Stops.” “Do you know it?” he asked. Forster, he said, had foreseen such possibilities.

“But I don’t know if I can complete the pieces,” he went on. “I fear I am losing ground fast.” He was having trouble breathing and was growing weaker.

No one taught me more about how to be a doctor than Oliver Sacks. I first encountered his writing during medical school, when I picked up his classic collection “The Man Who Mistook His Wife for a Hat.” The stories in the book were more than a decade old—ancient history, in medical science—but Sacks’s voice was already timeless. He told, simply, of a few patients he had seen, and their unusual neurological conditions. But he did so with the sort of inquisitiveness and observational power that I, as a young doctor-to-be, could not help but want to emulate. He captured both the medical and the human drama of illness, and the task of the clinician observing it.

“Dr. P,” the subject of the famous title story, was a distinguished musician and teacher at a school of music who’d lost the ability to recognize the faces of his students. At the same time, oddly, “he saw faces when there were no faces to see: genially, Magoo-like, when in the street he might pat the heads of water hydrants and parking meters, taking these to be heads of children; he would amiably address carved knobs on the furniture and be astounded when they did not reply.”

Sacks was unendingly curious, and I, like millions of readers, eagerly followed him on his explorations—into why music moves human beings, what it’s like to have amnesia or autism or drug-induced hallucinations, what was wrong with this man who could not recognize faces. Dr. P was a puzzle, and Sacks regarded him with unapologetic fascination. So did we all.

It could make me uncomfortable at times. Sacks observed his subjects with a naturalist’s dispassion, and when his descriptions made me laugh or gasp or turn the page to find out more about the person’s predicament I felt complicit. Following Sacks as he examined Dr. P from head to toe, we learned that Sacks could find no visual abnormalities or telltale signs. But, when he asked Dr. P to get dressed afterward, the patient had trouble figuring out if his foot had a shoe on it or not. Then, when that was sorted for him, “he reached out his hand and took hold of his wife’s head, tried to lift it off, to put it on. He had apparently mistaken his wife for a hat!”

As a student, I wanted my unabashed enthrallment to be redeemed by an account of how Sacks’s often decidedly personal investigations resulted in a solution, a treatment. But mostly they didn’t. His careful observations of Dr. P gradually led to the conclusion that he had a disease that caused severe damage to the areas of the brain that process visual information. Nothing could be done about it. The disease advanced inexorably until Dr. P’s death. But it was still essential, Sacks wanted us to know, simply to understand. This was his deeper lesson. His most important role, as a doctor and as a writer, was to bear witness to the wide experience of being human. There was a tender passion beneath the dispassion.

“Studies, yes,” he wrote in the preface, but “why stories, or cases?” Because, he explained, the understanding of disease cannot be separated from the understanding of the person. They are interwoven, and this has been forgotten in our era of scans, tests, genetics, and procedures. He compared the modern clinical practitioner to the man who mistook his wife for a hat—able to register many details yet still miss the person entirely. “To restore the human subject at the centre—the suffering, afflicted, fighting, human subject—we must deepen a case history to a narrative or tale,” he wrote.

I got to meet Sacks just twice. The first time was in 2002, when, as a surgical resident and a fledgling writer for this magazine, I went to hear him speak at The New Yorker Festival. He had a reputation for being introverted, awkward, but onstage he was warm, funny, and less purely cerebral than I expected. He was the same way when I spoke to him afterward. He’d read my essays, I was surprised to learn, and he asked me about an idea from one that had stuck with him. I don’t remember the subject now. I do remember the shift in me that came from our brief conversation. Up to that point, I’d regarded writing as a lucky sideline to my surgical career and hardly felt like someone who deserved to call himself a writer. But, because Sacks seemed to be holding my work to a higher standard, I realized that I needed to as well.

The second occasion was in March, 2014, when Sacks came to a lecture I was giving at Rockefeller University, in New York. He was eighty then and walked with a cane, but was only physically slowed. During our long conversation afterward, he told me about the memoir he was just finishing, which would be called “On the Move.” I told him about the book on aging and dying that I was finishing. We sent each other our manuscripts and entered into a correspondence.

Later, he learned that a rare cancer, which had been treated nine years earlier, had returned and was spreading throughout his body. He made the news public this past February, in the Times, in the first of four extraordinary essays in which he turned his unflinching powers of observation to his own condition. “Now I am face to face with dying,” he wrote. “The cancer occupies a third of my liver, and though its advance may be slowed, this particular sort of cancer cannot be halted.”

A month later, he sent me a letter. He’d just undergone a catheter procedure that delivered chemotherapy and clot-inducing particles directly into his liver, in the hope of reducing its load of metastases. “I feel awful now, but a little better every day,” he said. He was, as ever, looking forward to getting back to writing, and he managed to keep his writing going right to his final days.

In the last letter I received from him, he admitted to being tempted to think in pessimistic, “even apocalyptic terms.” But he was held back, he said, by the thought of the people who would continue after him: “good scientists, good physicians, etc., who give me hope for the future—a hope one needs very much when one’s own life is close to the end, and the negativities of life seem to darken the horizon.”