“I wish I could go back when a younger Artie did heroin for the first time. I wish I could tackle that guy and stop him from doing it.” — Artie Lange on this week’s episode of HBO’s “Crashing”

On “Crashing,” comedian Pete Holmes plays a version of himself.

It’s a time-honored tradition for comics, from George Burns and Gracie Allen playing themselves on radio shows in the 1930s and 1940s to TV shows such as “Seinfeld” and “Curb Your Enthusiasm.”

The difference with “Crashing” (now in its second season): The Pete Holmes on this droll and smart episodic arc isn’t remotely successful. He’s an open-mic hopeful who depends on the sofas and spare bedrooms of actual working comedians for his lodging.

“I like playing the regressed version of myself,” the former Chicagoan told me in an interview. “The grown-up in me knows better, but this guy is stepping in it left and right.”

A story line in Season One was about Pete’s budding friendship with Artie Lange, the immensely talented, immensely popular and immensely self-destructive comic who, unfortunately, is as famous for his struggles with addiction and his myriad run-ins with the law as he is for his work on “Mad TV,” his time as Howard Stern’s sidekick and his sold-out appearances at Carnegie Hall.

The naïve, God-fearing, aw-shucks Pete hanging with the deeply cynical, chain-smoking Artie made for some darkly funny moments — and some genuinely effective drama.

And then the real-life Artie Lange was arrested for possession of heroin and cocaine.

One could understand why HBO, Holmes and executive producer Judd Apatow would want to move forward without him in Season Two. After all, “Crashing” is a comedic travelogue, with Holmes briefly entering the lives of Sarah Silverman and Bill Burr et al. before moving on (or getting kicked out). It would have been easy to point Pete down a path where he never encountered Lange again.

Instead, “Crashing” not only brought back Lange, it did so with an episode that almost feels like an intervention.

• • •

Sunday night’s episode of “Crashing” is titled “Artie.” The setup: When veteran comedian Wayne Federman tells Pete he’s taking time off to battle Hodgkins, Pete takes it upon himself to organize a fundraising night.

Pete finds Artie on the sidewalk in front of a comedy club, taking a selfie with a fan.

“Do me a favor,” Artie says to the fan. “Tag me on that, so people know I’m alive.”

After Artie agrees to headline the fundraising event, Pete earnestly tries to steer him away from his bad habits — and truly believes he’s making a difference.

Let’s just say it’s not that easy.

Holmes says Apatow suggested addressing Lange’s problems head-on.

“We approached Artie and asked if he’d be open to acting as himself at a low point in his life, for the camera. He couldn’t have been more on board.”

In a separate interview, Lange told me, “This episode was hard to do, but I wanted to do it.

“Pete, in a weird way, looks up to my character, and I have affection for him. He’s another in a long line of people trying to help him.”

“Him” as in TV Artie. Who’s not all that different from real-life Artie.

• • •

Full disclosure: I consider Artie Lange a friend.

I’ve known him since his days on the Stern show. We’ve hung out when he’s played in the Chicago area, from the Hammond Horseshoe to Thalia Hall.

When I saw him last summer, he didn’t look good. A few days later, he was in the hospital after collapsing.

In December, Lange was arrested by New Jersey police for failing to appear in a Newark court on a drug charge from May 2017. He faces sentencing on Feb. 23.

“I feel really good,” Lange told me. “I’ve got that court date, and the judge will assess what’s going on.

“My career has never been crazier. I’ve got the podcast [with Anthony Cumia], ‘Crashing,’ a new book coming out. I never thought I’d be relevant at 50.

“There’s a Bugs Bunny cartoon where he’s walking down the street, and a girder from a construction site picks him up. And he doesn’t even notice it. And every time we think he’s gonna fall, another girder picks him up. That’s me. But one of these times, there’s not gonna be a girder.”

Lange hasn’t seen the “Artie” episode of “Crashing.” He’s going to watch it Sunday.

“It felt good when we did it,” he said. “I can’t wait to see it myself.”

I suggested Lange pay attention to the Artie character. Not every addict has the opportunity to see his life flash before his eyes, when there’s still time to make a change.