Last winter, in the middle of my intern year, I became Facebook friends with a young man who was dying in the intensive-care unit. An investment banker in his mid-20s, he thought he was healthy until a fluttering in his chest and swollen ankles took him to a doctor. Now he was in the I.C.U. with a rare cardiac condition and the vague possibility of a transplant.

And his laptop. That’s the first thing I noticed the morning a group of us stood outside his room on rounds. He was shocked by his internal defibrillator three times the night before — died, that is, three times before being brought back with jolts of electricity. And this young man with a steroid-swollen face was surfing the Internet.

In medical school, when we cut open a cadaver and lifted the heart from its silent cage, it was beautiful and unreal. With this patient, it was clear to me that there would be no poetry. He was dying, and it would be ugly, and I knew I couldn’t help him. He terrified me.

Eventually, I was sent in to pull a central line out of his neck. “Hey,” I said. I told him I was just going to cut out the stitches and then pull out the line — basically a large IV for giving drugs — from the vein deep inside. It would bleed, and I’d apply pressure for a while. When I pulled, I told him, I wanted him to hum.