As we ascended the trail into Los Angeles’ Griffith Park, Jon Hamm gazed up at the scrubby ridge to our left. From our perspective, the ridgeline traced a clean horizon, uninterrupted by cell towers or midcentury modern palaces. He nodded toward a man sitting up there alone.

“See that dude sitting on the point there?” he asked. I looked: The dude could have been meditating or having a Don Draper moment, dreaming up the next big Coca-Cola campaign.

For Hamm, the image of the man brought him back to 2017, when he first moved to the Hollywood Hills neighborhood of the city. His career-making, Emmy-winning role as Draper in the AMC drama “Mad Men” had ended two years before, as had a romantic partnership of 18 years. It had been by most accounts, including his, a tough period of transition.

“I was newly single — I was like, I just need to concentrate on myself again,” he recalled. “And I would just take this walk, every day,” to the top of that ridge, and then back toward his house, memorizing lines along the way.

Eventually he began to settle into his new home, his new neighborhood, his new rhythm. He turned a corner, pushed ahead.

We had met up that sunny afternoon in late February, along with Hamm’s beloved rescue dog, Murphy, to hike and talk about his new Apple TV+ drama, “Your Friends & Neighbors,” his first lead TV role since playing Draper a decade earlier.

Draper, a brilliant and enigmatic ad executive, had been singular, a defining character not only for Hamm but also in the pantheon of antiheroes from prestige TV’s golden age.

It is also a role that Hamm, 54, spent the years just after “Mad Men” trying in some ways to cast off. Success after Draper hardly seemed assured. Articles from that time bore headlines like “Jon Hamm’s Second Act,” “So, What Now, Jon?” and “Jon Hamm Is Ready to Break Free From Don Draper.”

“It doesn’t matter how awesome or successful or genre-defining, career- defining” a thing is, he said. “As soon as it’s over, everyone’s like, What’s next?”

What came next for Hamm was largely a series of quirky guest roles and supporting roles on TV and a run of movies that reaped decidedly mixed results, the upshot being that there weren’t many headlines of any sort for a while.

But it seems obvious now that however one defines Hamm’s second act, he is easing into a third. It is an act defined so far by a string of high-profile TV roles (“Fargo,” “Landman,” “The Morning Show”); by an invitation to introduce the Kansas City Chiefs at Super Bowl LIX; and by his first “Saturday Night Live” hosting gig in 15 years. Suddenly, he is everywhere again.

He also feels freer now to play with that Draper-like persona, he said. Hamm’s new series, now streaming, is in some ways a return to the themes, style and wardrobe that made him famous. As the slick hedge funder Andrew Cooper, his character seems at least partly predicated on viewers’ memories of Draper.

“There’s something to be said for that,” Hamm, who is also an executive producer, acknowledged. “There’s also something to be said for subverting that.” “Your Friends & Neighbors” is ultimately a crime caper and a critique of conspicuous consumption. As Hamm put it, “Don was a seller, and Coop is a buyer.”

Perhaps most important, this is the act in which Hamm has become a happily married man, at peace with where he is, with his past, his inner critic — a peace, he said, that he has begun to find in only the past five years.

Historically, there are reasons for Hamm’s fans to assume he is existentially conflicted. Draper’s darkness was irresistible, deeply literary and steeped in manly trauma, and that is part of it.

But there is also Hamm’s bio: He lost his mother at 10, and then his father at 20. More than most, he had to summon the wherewithal to succeed on his own.

“I was a late bloomer in every sense,” he said. “As my therapist would say, I’ve always been kind of surviving, and only in the last 20 years or so have I been able to really participate in life in the way that my friends that had normal adolescences growing up” could. He worked various jobs beginning at age 16, including as a teacher after college, and moved to Los Angeles at 24.

Unlike many people with humble origins, Hamm rarely lacked confidence, said Robert Lawson, a friend since high school. It helped that Hamm was good-looking, played football. It helped that friends and other families supported him, particularly after his father died.

Success with “Mad Men” came relatively late, in Hamm’s mid-30s, and it was incandescent. Suddenly the paparazzi were always parked outside his house and shining lights in his face as he exited a restaurant or bar.

As “Mad Men” ended, in 2015, there were signs of strain. A cascade of difficulties swamped his personal life: He separated from his longtime partner, actor and screenwriter Jennifer Westfeldt; he went to rehab for alcohol addiction; an old fraternity hazing episode, in which the victim needed medical treatment, was resurfaced by reporters. (Hamm was charged with hazing but ultimately not convicted.)

“It’s like anything else, there’s no way over but through, right?” he said in a later interview about the challenges of that time. “You can avoid it, or you can not deal with it, but it doesn’t make it go away. You have to kind of go through the steps.”

But he worked hard, meanwhile, not to be typecast. He turned down roles that seemed too Draper- like and avoided working with other “Mad Men” alumni. He did thrillers (“Baby Driver,” “Beirut”). He did more comedy, a lot of it (“Confess, Fletch,” “30 Rock,” “Unbreakable Kimmy Schmidt”).

His attempts to become a go-to leading man in the movies was met with middling box-office success. “Does that say that the audience doesn’t want to see me in movies?” he said. “I don’t know; I don’t think so. I think that there’s so many other things that go into it.” But he established his range and comedic bona fides, and he landed roles in some of the biggest movies around, like “Top Gun: Maverick.”

The work was varied and steady. A few years after moving to the hills, he began a relationship in earnest with actor Anna Osceola, now his wife, whom he had met while taping the final “Mad Men” episode — the one with Draper’s Coca-Cola meditation. His new house became a home.

Those who know him well attest to his newfound contentment, to the progress he has made since the period when “Mad Men” was ending — “a really tough time,” as Lawson described it.

“Drinking with Jon Hamm during those days was different than having a drink with Jon Hamm now,” he said. “He definitely has come out on the other side,” he added, “and I think meeting Anna was such a great thing. He is as happy as I have ever seen him.” (Hamm does still have the occasional drink and said people often wrongly assume that “I’m off the wagon” because of his short rehab stint. “I’ve never claimed to be a sober person,” he said.)

As his co-star in “Mad Men,” John Slattery saw firsthand “the real rocket ride” Hamm was on for a while. As his friend, he sees where he is now.

“He just makes sound decisions, despite whatever pressures may have been applied externally and internally,” he said. “I’m just happy that he’s in the place he’s in.”