SAN FRANCISCO — In a star-driven league, the Nets’ next coach must have a good relationship with Kyrie Irving and Kevin Durant. It’s hard to imagine anyone having a better one than Lakers assistant Phil Handy, whom Irving calls family.

While Irving won under current Lakers assistant Ty Lue in Cleveland, he was closest with Handy, an assistant on Lue’s staff. That’s no guarantee Handy will be a candidate for the Nets full-time job, but it helps to have friends in high places.

“Obviously me and Kyrie spent four years together in Cleveland, tremendous growth for him,” Handy, 48, told The Post. “When I got to Cleveland, he was still a young kid just trying to figure it out. I was able to help him learn how to be a pro, and our relationship went way further than basketball.

“Off the court, we spent a lot of time together. We were neighbors. We lived two or three doors from each other, so it was a lot of growing and maturing.”

Jacque Vaughn has won his first two games as interim coach since replacing Kenny Atkinson. But Irving specifically wanted Handy to join he and Durant in Brooklyn last July, according to CloseUp 360. Handy ended up as an assistant with the Lakers, at LeBron James’ behest.

The Post caught up with Handy on Tuesday, and he stressed he’s happy in his Lakers gig. And after reaching five straight Finals — four with Cleveland and last year with Toronto — he’s got a shot to make it six.

kyrie irving phil handy cavaliers lakers nets coach
Cleveland Cavaliers’ Kyrie Irving is hugged by assistant coach Phil Handy after Game 7 of the NBA Finals in2016.Bay Area News via Getty Images

But after that? Sean Marks would do well to at least look at Handy. After Atkinson’s voice stopped carrying the same weight in the Nets’ locker room, it would behoove the Nets GM to look at coaches well-respected by the sports’ stars.

Handy fits the bill, held in high esteem by Irving, James, Kawhi Leonard and the late Kobe Bryant.

“He’s kind of like my dad, in terms of in basketball, when I’m away from my family,” Irving told the Undefeated in 2016. “So he’s been influential in my life.”

Relationships matter. Handy played in Melbourne — where Irving was born and where Nets staffers Dan Meehan, Les Gelis and Daniel Jones hail from — and was called an “excellent coach” by ex-Cav Joe Harris.

But Handy’s bond with Irving could be key in managing the Nets’ star. Irving has had a tough year, from surgery to amateur analysis over his headspace. Handy, who knows him better than most, said Irving won’t be happy unless he’s playing.

“For him now, guys go through little phases in their careers where you hit little road bumps, you get some injuries,” Handy said. “He’s one of those guys, if he’s not playing basketball he’s not happy. So all of those things he’s going through are just growing pains.

“When he’s away from it — when he’s away from the court — guys that love the game that much, when they’re not able to play, different things begin to happen. But that kid’s future is still on the climb. He’s got a great future ahead of him. The more he can play, the happier he’ll be.”

Handy will be part of Irving’s future, but will it be as the Nets’ coach? He seemed surprised at the notion and let out a hearty laugh.

“I’ve learned a lot about this business. One, I have a job — my focus is on my job here,” Handy said. “Whatever opportunities come, if it’s the right opportunity and it works out, I’ll be ready for it.”