Kings center Alex Iafallo defends Rangers center J.T. Miller on...

Kings center Alex Iafallo defends Rangers center J.T. Miller on Sunday, Jan. 21, 2018. Credit: AP / Michael Owen Baker

SAN JOSE, Calif. — On and off the ice, J.T. Miller has had a sort of love-hate relationship with Rangers coach Alain Vigneault and his predecessor, John Tortorella.

They’ve admired the tenacity, energy and north-south game of the Ohio native, now 24, who produced a career-best 56 points with 22 goals and 34 assists last season.

But Miller’s defensive lapses early in his career, including coverage issues and high-risk plays, had prompted coaches to bounce the left wing back and forth from AHL Hartford to work on his two-way game.

Between the 2012-13 and the 2014-15 seasons, Miller spent 101 games in the AHL, but he now is riding a streak of 247 consecutive regular-season games.

To be sure, Miller — a former member of the U.S. National team — has matured and improved, and Vigneault has used him up and down the lineup, from the first to the fourth lines, and sometimes at center. He scored the overtime winner at the Winter Classic at Citi Field but also has had some bad moments.

After a costly gaffe on Tuesday that led to a Ducks goal and a benching for the rest of the game, Miller vowed to have a smarter, tougher performance on Thursday night against the Sharks. And he did, contributing what proved to be the winning goal along with two assists in the Rangers’ 6-5 victory.

“Our team needed that,’’ said Miller, whose goal was his 11th of the season. “It’s a good way to cap it [the road trip] off. Sometimes it’s not pretty, but we did a good job of making plays when we had the opportunities.”

Miller delivered right away against the Sharks with an assist in the first period. His perfect outlet pass to Kevin Hayes was followed by Hayes’ goal on a slap shot from just inside the left faceoff circle to give the Rangers a 1-0 lead.

“There’s no point in sitting back and feeling bad for yourself,” Miller said at Thursday’s morning skate at SAP Center, where the Rangers tried to regroup after losing three straight games on this road trip. “I know my play needs to be elevated. My response needs to be a strong effort. I’m going to focus on today, not worry about the last game. The team needs to have a good game and I think when I’m playing well, that helps.”

With the Rangers down 3-2 late in the first period on Tuesday, Ondrej Pavelec relieved Henrik Lundqvist, and Miller’s miscue — a mid-ice pass on a power play — was easily picked off by Ryan Getzlaf, who sent Adam Henrique in alone. His deke left Pavelec sprawling and provided a 4-2 lead at 18:38. Vigneault said afterward: “I’d seen enough.”

“I’m not surprised by what happened. I made a pretty careless play up the middle,” Miller said Thursday. “It’s not rocket science. I just have to stay within my game . . . You’ve got to make plays when it’s there. You can’t try to force it. I tried to and it pretty much ended up in the back of the net. You can X-and-O it as much as you want, but I evaluate myself pretty fairly and I know that I was not good enough.”

Miller was unhappy but remained upbeat on the bench.

“At that point, you just want the team to win; the guys actually played a pretty good game, got a lot of shots, had some good looks,” said Miller, who is a plus-5 this season after going a career-high plus-17 last season. “I can’t make it about me and be a distraction. You have to be a good teammate and move forward.”

To his credit, Miller knows how he needs to adjust and execute. “I’ve got to play to my strengths,” he told reporters on Thursday. “When I’m doing that, I’m skating and being physical, and I’ve told you guys a million times, I’ve got to get in on the forecheck and start hitting people. I can’t look to make plays all the time. I’ve got to shoot the puck a little bit, move my feet.”

Vigneault praised Miller for “a very professional attitude. He turned the page [the next day]. J.T. does a lot of good things on the ice but sometimes puts himself in a little bit of trouble with decisions with the puck. He just needs to take the high-percentage road and he’ll be in good shape.”

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME