One afternoon recently, I was in the intensive-care unit, encouraging a middle-aged patient with early signs of cardiovascular disease to take better care of himself. He wasn’t having a heart attack. But I assumed that landing in the ICU grabbed his attention, making this an ideal teachable moment.

“It’s just that I’m too tired when I get home at the end of the day to go to the gym or cook a healthy meal,” he said, shrugging his shoulders and looking exasperated.

Like most patients in his situation, he was feeling down about his poor health and even a little guilty. But he insisted he just couldn’t find the time and motivation he needed to change his circumstances.

I tried my best to be kind, and not let my frustration show. “What could be more important than maintaining your health?” I asked him. Another shrug.

When I left his room, I checked my watch. It was already 3 p.m., and I still hadn’t found time for lunch, and not really breakfast, either, unless you count a hastily gulped granola bar and a few cups of coffee.

Skipping a proper breakfast meant I had an extra 10 minutes of sleep, which I always need.

I ran to the cafeteria and grabbed a sad-looking slice of cold pizza that apparently nobody else wanted. I congratulated myself for remembering to dilute yet another cup of coffee with cold water so I wouldn’t burn myself as I drank it down. I dined while climbing back up the stairs to the ICU, savoring a few quiet minutes.

This is not an uncommon experience for me or my colleagues as we acclimate to the demands of being new doctors. Skipping meals, exercise, sleep — and keeping afloat on coffee — is standard behavior.

But in that moment in the stairwell it occurred to me — I was violating every last bit of the excellent advice I had just given my ICU patient.

Often we hear that doctors make the worst patients.

But it is certainly not for a lack of knowledge. We advise patients on healthy behavior all the time, and we study its importance in improving their outcomes. We encounter patients with devastating illnesses so often that we couldn’t possibly take our own health for granted — except when we do.

Training to be a surgeon comes with the privilege of serving patients and learning medicine, of pursuing my dream. To me, skipping meals and losing sleep didn’t feel irresponsible or harmful; it felt selfless and justified.

Which may be exactly how my patient felt about how he uses his own time.

I used to have a hard time understanding patients who carried on with their unhealthy behaviors, even after being diagnosed with a disease.

Now I understand that we all have our own reasons for failing to do what’s best for our health. Maybe money is tight, and the family has troubles. Maybe multiple jobs mean long hours — like my own schedule — leaving little time or energy to exercise or to shop for and cook healthy meals. Or maybe lack of health education is the problem — an excuse I obviously don’t have.

Understanding that my patients — just like me — have challenges that make it hard to prioritize health helps me to connect with them. As a physician, I can provide better care if I try to understand what’s holding my patient back from making healthy choices.

Balancing immediate needs with long-term priorities is tough for all of us. I can’t stop trying to help people such as the man in the ICU with sound health advice, but I can listen more, and accept that we are all finding our own path.

Jason Han, M.D., is a resident in cardiothoracic surgery in the Perelman School of Medicine at the University of Pennsylvania. The opinions expressed in this article do not represent those of the University of Pennsylvania Health System or the Perelman School of Medicine.