Mike Gauthier lost his best friend, Ted Cox, in 2012, but still listens to the voicemails he left.

He listened to them when he got married last summer and wished Ted was there. He plays them when he hears a song that Ted liked.

The voicemails are rambling and whimsical, filled with details of Ted’s day and local gossip, ending with his trademark “I’ll talk to you when I talk to you.”

It’s been over a decade, but Mike says, “I carry him every day in my heart.”

Friendships influence our lives, even after a friend is gone. And for men, who often have fewer close friends, the relationships they have are especially meaningful. A Harvard study of men found that those who had satisfying relationships, including friendships, at 50 were the healthiest, mentally and physically, at 80.

Some mementos can reawaken times spent with those friends. For Mike, it’s Ted’s voicemails.

Fewer of us leave voicemails these days, preferring to hang up or text. Still, a voicemail can capture a person’s playfulness, phrasing and tone, and help retrieve a memory that might otherwise be buried, says neuroscientists. It can surface positive feelings of what it was like to be with that friend, and who you were at that time—optimistic, altruistic, carefree—and a sense that you can be that person again.

A friendship grows

Mike and Ted were years apart in age but formed a tight bond. They met in the summer of 1989 as seasonal workers at Olympic National Park in Washington. Mike was 19, a college sophomore from Seattle who liked climbing and hiking. Ted was 47, known as the crazy guy who hiked 60 miles in a day, drove an old car with no gas cap, and read ancient history.

“I was like a moth to flame,” says Mike. After work, they ran 20 miles, Ted insisting on the most difficult trails, singing “Danny Boy” or “Joe Hill.

Bonds formed at that age often stand out. Between adolescence and 30, our worlds expand beyond family and our friends become adventurous partners and confidants. Memory researchers refer to that period as the reminiscence bump.

“It’s when people’s identities develop. If you have friends from that era, you think of them more,” says Charan Ranganath, a neuroscientist who studies memory. One survey found that we meet our best friends on average at age 21. We can maintain those bonds by spending time together.

Over the next two decades, Mike and Ted shared countless hours together climbing mountains, driving and talking on the phone. Both single, they would show up at each other’s houses, unannounced and always welcomed.

“I would call, say ‘Ted I got the weekend off. Want to do something?’” Mike recalls asking, and Ted saying yes. Mike said girlfriends would complain about him spending so much time with Ted. “He’s a part of my life. I’m not sure you will stick around but Ted will,” Mike would explain.

Their relationship was symbiotic. Mike was 26 and a seasonal ranger at Mount Rainier when two climbing partners died on a rescue. He saw Ted after, and recalls him listening, consoling and sharing his own worst fears. “Oh dear God, Michael. I thought you were dead,” he remembers Ted saying, and adding in a way that lightened the moment, “I thought, ‘I’m going to have to go buy a goddamn suit.’”

In time, the roles reversed. When Ted didn’t have a job, Mike, who moved up the ranks at the National Park Service, hired Ted as a custodian at Mount Rainier. Mike treated Ted to all-you-can-eat buffets, where Ted tried every dessert and kept vanilla ice cream at home for Ted. When Ted bought 20 remote acres in Alaska, sight unseen, Mike drove up with him and helped build a small wood cabin, with a few other friends.

One of those friends was Shaun Bristol. “They were so close,” says Bristol, who described the friendship between Mike and Ted as brotherly, bantering but there for each other.

Hearing his voice

When Mike worked in Washington, D.C., for two years as a liaison for the National Park Service, they talked for hours on the phone. Mike dreamed that Ted died. “I remember waking up sad and empty,” he says. “I worried about missing him.”

He began keeping the voicemails Ted left. “This is Ted at noon at Camp Muir on a windy afternoon. Just want to chit chat, see what is cooking. So the season’s winding down. Teddy pooh is going to Alaska.”

In one, Ted describes cresting a hill, seeing Denali come into his view, and urges Mike to come back West. “You gotta be here. Get out of that place. Let’s go!”

He would question Mike: “It’s a few minutes to 8 on Tuesday morning. Where are you? Aren’t you going to work? Oh, it’s Christmas week” and at times speculate on his whereabouts: “You’re probably out at an expensive restaurant eating, being served fine cheesecake.” He gave his opinions: “God almighty it’s expensive in Alaska to stay just for a flop, but it’s a nice little cabin they gave me actually. But there’s no indoor plumbing. You have to go over to the lodge to go take a pee.”

In 2012, Ted began having stomach pain. It was cancer. Ted, a frequent library patron, worried about paying his fines from overdue books that filled his small house, including his bathtub. Mike went with Ted to the library to pay them.

A few months after his diagnosis, Ted died. Mike and other park service workers organized a memorial and served vanilla ice cream.

Mutual friends say Mike knows officials in Washington, world-class mountain climbers and chief executives.

“Mike knows a million people and for him to still be missing Ted speaks volumes about how close they were and how important he was,” says Lynn Dettinger, who worked on Mount Rainier with them.

In the years since Ted died, Mike says he finds himself listening to the voicemails after reading a story about friendship, hiking up to the cabin they built in Alaska, or hearing Ted’s favorite songs by his favorite singer, Paul Robeson. One song, “Joe Hill,” has new poignancy.

“I dreamed I saw Joe Hill last night, alive as you and me. Says I “But Joe you’re 10 years dead.”

“I never died,” says he.

“I never died,” says he.

Last summer, Mike, 54, married. His closest friends came. He missed Ted. Shortly before the wedding, Mike listened to the voicemails. The quality isn’t great and Ted talks fast, but Mike knows what Ted is saying.

He is glad he saved them. “They make me smile and laugh, and help me to recall memories and experiences that time would have very likely erased,” says Mike.

Write to Clare Ansberry at clare.ansberry@wsj.com