Patrick J. Adams says his return to “Suits” in Wednesday night’s episode took over a year to engineer.

“Typically, [series creator] Aaron Korsh has a sort-of idea of what could happen the following season,” says Adams, 37, an original cast member who left “Suits” in April 2018 after playing brilliant, faux attorney Mike Ross on the USA legal drama, wrapping its nine-season run Sept. 25.

“When I left it was on good terms and we’re all still good friends, and it was always the idea that if it made sense in a bigger story, Aaron would be open to [my return],” says Adams, who will next play astronaut John Glenn in the National Geographic miniseries “The Right Stuff.”

“We didn’t chat for a long time — it was almost a year after I left the show — but Aaron reached out and said, ‘Let’s grab dinner,’ and he pitched me this idea of how Mike could come back into the fold for the last season,” Adams says. “Luckily everything lined up perfectly and I thought the story was great.”

Wednesday night’s episode (9 p.m.) finds Mike, now a bona fide lawyer, returning to New York from Seattle — where he lives with wife Rachel — for a high-profile case involving his mentor/pal Harvey Specter (Gabriel Macht). But Mike isn’t there to play nice; he butts heads not only with Harvey, but with Samantha Wheeler (Katherine Heigl), one of the firm’s feisty partners.

“The big draw of the storyline was me interacting [with Heigl] in a major way. Working with her was great,” says Adams. “Not only does she rise to the occasion but she ups the game and brings a whole new energy, ratcheting it up even more.”

Adams says he was “actually pretty nervous” before shooting the episode. “I was away for so long, and on the plane going back [to Toronto, where “Suits” is filmed] I was looking at the script and thinking, ‘Oh, man, what if I lost whatever it was that made this fun?’ From the moment I left to when I came back it was like a year and a half, but as soon as I walked on the set it was like I was gone for a day — the same crew, same rhythm … it was like getting on a bike again. The rest of the cast are such dear friends and were warm and welcoming.”

‘I was looking at the script and thinking, ‘Oh, man, what if I lost whatever it was that made this fun?’ ‘

Adams won’t be appearing with his former co-star, Meghan Markle, who played Mike’s wife, Rachel Zane. For obvious reasons, the Duchess of Sussex is otherwise occupied — though there’s a sly reference to Markle’s worldwide celebrity in the episode.

Fans of “Suits” will, however, be rewarded with one of the show’s core elements — intense interaction between Mike and Harvey.

“It’s one of those weird, key things that makes ‘Suits’ ‘Suits,’ ” says Adams. “There’s so much antagonism but that’s sort of the beating heart of these two guys. There’s always that moment when someone’s finally gone too far, when you cross over into ‘You really betrayed me and you’ve hurt me,’ but for the most part that antagonism fuels their relationship. I think people love to see Mike and Harvey on the same side fighting together for something, but they also love to watch them be like two brothers chasing after the same goal and doing whatever they can to win a competition. They know that, at the end of the day, these two guys are going to forgive each other and find a way through it.”

Adams says he’s finished shooting the first episode of “The Right Stuff,” based on Tom Wolfe’s 1979 bestseller about the seven Mercury astronauts (the 1983 movie version starred Ed Harris as John Glenn). “I’ve seen the movie many times and [‘The Right Stuff’] was one of my favorite books growing up,” he says. “[Ed Harris] sits on my shoulder every day, but I’m grateful that I couldn’t be more different than him.”