Brett Gardner didn’t know much about DJ LeMahieu before they became teammates this season.

“A couple days into spring training, you could tell he was just a little bit different than everybody else — in a really good way,’’ Gardner said. “He’s extremely focused and really the same guy every single day. He’s all business.’’

The two ended up in the same hitting group in batting practice and Gardner makes a point of watching LeMahieu in the cage.

“Anyone who can hit like he does,” Gardner said, “I pay attention to and appreciate.’’

LeMahieu’s approach at the plate nearly got him his second batting title. He finished the season hitting .327, second only to Tim Anderson of the White Sox, who hit .335. His approach also earned LeMahieu the nickname “The Machine” from Gary Sanchez.

That approach, which has made him one of the most consistent hitters in the game, started long ago.

Bob Riker has been the baseball coach at Brother Rice High School in Birmingham, Mich., for more than two decades and still remembers one of the first times LeMahieu set himself apart from the rest of his players.

One night at about 10:30, Riker, who also taught science, was in his office grading papers.

“I heard someone hitting off a tee in the gym and I was ready to go in and chew someone out,’’ Riker said. “I walked in, saw it was DJ, watched for about 30 seconds and then turned around and walked out. I’d never had a freshman do that before. He doesn’t do things to be seen or for someone to notice. He just wanted to get better.’’

LeMahieu played four years for Riker — “When he got here, he was tall and gangly, like Bambi,’’ Riker said — and even then showed an ability to drive balls to the opposite field.

It’s a skill he took with him to LSU.

“Lots of people thought he was late on pitches, but that was by design,’’ said Paul Mainieri, who made LeMahieu part of his first recruiting class as the coach at LSU. “For DJ, it’s not about flipping the ball to right. We didn’t do anything with his swing when he got here. Our attitude was, ‘Just leave him alone and let him get his hits.’ ”

LeMahieu got enough of them — and big ones — that he helped Mainieri revive the LSU program. After missing the College World Series for three straight years, LSU got back to Omaha, Neb., in LeMahieu’s freshman season.

He also got the attention of Jim Hendry, who was the general manager of the Cubs and a longtime friend of Mainieri’s, dating back to their time in the Cape Cod League.

“I always loved the swing,’’ said Hendry, now an assistant to general manager Brian Cashman who advocated for the Yankees to sign LeMahieu when he became a free agent last offseason.

“He was thin and had to get stronger, but I was always believed that it’s a lot harder to teach that than to teach a guy to pull,’’ Hendry said. “There may have been a perception he was hitting flares and bloopers the other way, but I watched him and he hit the ball hard everywhere even back then.”

With the Cubs, Hendry drafted LeMahieu in the second round of the 2009 amateur draft, but it wasn’t until 2015, after a trade to Colorado, LeMahieu got a chance to be an everyday player in the majors.

He was an All-Star for the Rockies that season, won the batting title in ’16 and became an All-Star again in 2017.

After a somewhat disappointing season last year, during which he missed 34 games with injuries, Hendry again led the way for LeMahieu.

Cashman admitted he didn’t initially see a fit for LeMahieu in The Bronx, considering he was a Gold Glove second baseman and the Yankees already had a full infield — with Gleyber Torres at second, Miguel Andujar at third and Didi Gregorius expected to return from Tommy John surgery by midseason.

But Cashman was sold on LeMahieu’s versatility and eventually signed him to a two-year, $24 million deal.

As the regular season drew to a close, Cashman called LeMahieu “a game-changer for this roster and this franchise in 2019.’’

He lived up to all expectations, providing above-average defense at second, third and first base and hitting everywhere but eighth in the lineup before settling in as the regular leadoff hitter by mid-April.

LeMahieu’s .893 OPS trailed just Aaron Judge’s .921 among Yankees regulars.

“Nothing surprises me with him,’’ Hendry said. “Nobody’s smart enough to know he’d hit .330, but I wasn’t worried about him adjusting to New York or the spotlight. He loves the action. He loved it at LSU and in the College World Series.”

The 31-year-old LeMahieu has used a 34-inch, 32-ounce bat for most of his career. And the swing he was trying to perfect in the gym when Riker spied on him hasn’t changed much, either.

It took some time for it to pay off.

“This is just the way I’ve always been,’’ LeMahieu said. “It’s kind of my natural swing. It was a matter of recognizing that’s my natural swing and repeating it. And at every level you move up, it becomes more difficult to do it.’’

As the 6-foot-4 LeMahieu got stronger, the results improved.

“I always wanted to hit for more power and not just go the other way,’’ LeMahieu said. “That’s always the balance, to stay within myself.”

And even as he finished with a career-high 26 homers, topping his previous high of 15, set last year, LeMahieu still struck out at a lower rate (13.7 percent) than his average of 15 percent — and lower than anyone else in the Yankees’ lineup.

“He’s one of the most competitive mofos I’ve ever been around,’’ said Riker, who still plays cards, pickup basketball and ice hockey with LeMahieu in Birmingham during the offseason. “When he’s in the batter’s box, the ultimate failure is to not put the ball in play. That’s how he is. For him, it’s not about hitting home runs. It’s about squaring the ball up every single time.”

LeMahieu has never done it better than this season, when he found his way into the AL MVP conversation.

“I never considered myself a power hitter,’’ LeMahieu said. “I felt like I hit the ball hard. This year has been different. I didn’t know I could do this, but I believed it.’’

Now, the stage is set for LeMahieu to do it in the playoffs. He’s yet to have much postseason success. The Rockies lost the wild-card game in 2017 and won it last season, but were swept by the Brewers in the NLDS.

And Gardner will still be watching.

“He’s just so talented with the bat,’’ Gardner said. “As long as his arms are, he’s able to hit it hard the other way even when the ball is on the inner part of the plate. He manipulates the barrel somehow where he makes solid contact consistently. It’s hard to compare him to anyone else.”

Hendry, who also noted LeMahieu’s contributions defensively at second, third and first base, is just pleased they’re on the same side again.

“When you work as hard as he has for so long, you usually have success,’’ Hendry said. “And not many are gonna outwork that guy — if any. He turned out to be the perfect fit and with all the injuries turned out to be a godsend. If you don’t like that guy, you don’t like ice cream.’’