Xolo Maridueña received two phone calls the day he found out he’d been cast in “Cobra Kai,” the spinoff series set three decades after the 1984 “The Karate Kid” movie ended. The first came from show creators Josh Heald, Jon Hurwitz and Hayden Schlossberg, who confirmed that he had landed the protagonist role of Miguel Diaz, the scrappy Reseda teen that learns martial arts after being bullied. Maridueña, then 16, couldn’t believe his luck.

“Oh my God, what is going on?” the now 23-year-old said via Zoom, recounting the events of that afternoon like a play-by-play commentator. Then, his phone rang again. This time, it was Ralph Macchio, the karate kid himself.

“Is this Zolo ?” asked Macchio. Though Maridueña laughs now at the wrong pronunciation of his name (it’s “sho-low”), the young actor was too preoccupied at the time to correct his new co-star. With his phone’s battery at 1%, he worried that the call would drop, giving Macchio the impression that he was a bratty kid who’d hung up on him.

If that were to happen, Maridueña thought, surely they’d boot him off the show before shooting even began. That worst-case scenario never came to pass, and as Macchio can attest, Maridueña “is the antithesis of a bratty kid.” In truth, he was tailor-made for a role that saw him grow from a brace-faced teen into a full-fledged adult.

Now, seven years after that fateful day, the actor is getting ready to say goodbye to Miguel Diaz — the first p.