It was going to go one of two ways for the Red Bulls when Jesse Marsch, their head coach of the previous 3¹/₂ successful seasons, suddenly left the club in early July to coach RB Leipzig in Germany.

There was, however, only one way Chris Armas was going to allow it to go once he was elevated from his assistant coach role to replace his mentor: onward and upward.

So what if midseason coaching changes sometimes can become distractions that derail teams? So what if Armas had never been a head coach on the professional level before?

He’d been preparing for this moment his entire life.

“If I could have locked into a 20-year assistant coach job for $1 million a year, I would not take it,’’ Armas told The Post. “I wasn’t signing up to be an assistant coach. I was going to be a head coach.’’

In early July, it finally happened, and Armas embraced the sudden change and all of the challenges that came with it because nothing has ever come easy for him. So in a way, he felt right at home.

Career disappointments? He’s had a few, starting with the two World Cup teams on which he was poised to play only to suffer knee injuries right before both of the international competitions were to begin.

So what if Armas, a soccer lifer who grew up on Long Island and played college ball at Adelphi, never got to play on a World Cup team despite twice having earned the right to do so?

After his distinguished collegiate career, he craved the chance to play for the local MLS club, the New York MetroStars (which later became the Red Bulls) and got drafted to play in LA instead?

Now, all these years later after missing out on the chance to play for the local club despite playing in MLS for 12 seasons, Armas has the chance to do something no one has ever done: lead the Red Bulls to the MLS Cup, after 23 years without one.

Armas’ Red Bulls play at 3 p.m. Sunday at Columbus in the first leg of the MLS Eastern Conference semifinals as the league’s No. 1 seed. The two teams will complete the series at Red Bull Arena on Nov. 11.

The Red Bulls, who own a league-best home record of 98-22-31 since Red Bull Arena opened in 2010, were 4-2-1 when Marsch departed. They’re 12-3-3 since, having hunted down Atlanta to win the Supporters’ Shield by winning their final five regular season matches.

The seamless transition from Marsch has been a testament to Armas and his preparation for the moment, knowing it eventually was going to come to him.

“We have a good team that can go all the way, but there were certain challenges I was going to face early on and I knew that,’’ Armas said. “I’m a first-time head coach in this league, but I’m not a young guy, I’m not an inexperienced guy. So it’s been in the making.

“When the transition came, it was going to be mostly about going from the secondary voice to being the guy in charge, standing and leading every meeting. That’s a big jump. Now, it was about being believable in front of that group. They have to see you as that leader. Because when the leader [Marsch] leaves, they’re a little like, ‘Whoa, what’s going on, how’s this going to be?’

“Look, there were probably questions at first. It was like for the substitute teacher that comes in and the classroom feels like, ‘Now we have some leeway here.’ There were some specific moments when I’ve had to address some players — whether it’s not starting a guy, having some tough meetings with guys. Those were some defining moments for me to say, ‘I’m a nice guy, but don’t mistake kindness for weakness.’ I’ll act swiftly to show that, ‘Yeah, I’m a nice guy, but I’m here to win.’ ’’

The most powerful thing Armas had in his pocket was the immediate endorsement from his two veteran stars — striker Bradley Wright-Phillips and goalkeeper Luis Robles.

“The challenge was always going to be: How do I be Chris Armas instead of Jesse Marsch 2.0?’’ Robles told The Post. “That lasted for a few weeks, but he’s been remarkable in that he has put his own stamp on the team. It’s been very positive.’’

Red Bulls sporting director Denis Hamlet, who coached Armas as a player with the Chicago Fire and has been around him for years, never flinched when elevating him to replace Marsch.

“I knew the special qualities he has as a person and him working with Jesse and understanding our philosophy and that made the transition seamless,’’ Hamlet said. “Chris’ ability to connect with people and his ability to reach people is something special. That’s his niche. He’s played on championship teams, he’s won championships, he’s been a part of this league, he’s seen it all. So he knows what it takes to win.

“He’s a winner. Now he’s spreading the experience and knowledge to our guys and hopefully they can take that and help them in their journey.’’