The Mets' Keith Hernandez high-fives Mookie Wilson as he crosses...

The Mets' Keith Hernandez high-fives Mookie Wilson as he crosses the plate after a first-inning home run in the second game of a doubleheader against the St. Louis Cardinals at Shea Stadium on June 21, 1983.  Credit: AP/Ron Frehm

Thirty-seven years ago, Keith Hernandez was kind of bored.

He was 29 years old and the star first baseman for the World Series champion Cardinals. He won the batting title and earned a share of the National League MVP award in 1979. He was a two-time All-Star. He won five straight Gold Gloves and one Silver Slugger. When St. Louis won it all in the fall of ’82, it meant “the only thing left to achieve,” as Hernandez put it recently, had been achieved.

“I went through a doldrum period,” he said in a phone interview with Newsday. “I had run out of goals.”

He expressed as much to teammate and friend George Hendrick, who wasn’t as accomplished but who had more years in the league. Hendrick told Hernandez it would pass. Everybody goes through it. It’s fine.

Hernandez said he eventually would have found a new goal to reach for with the Cardinals, because the team still was good and there is nothing quite like a pennant race. But he never got the chance.

On June 15, 1983 — 37 years ago Monday — the Cardinals traded Hernandez to the Mets, massively changing the course of his life and the team’s history for the better.

Even though he initially hated it.

“Now I had a new challenge with the last-place Mets,” Hernandez said. “That opened up a whole new motivation for me.”

The buildup

A lack of professional motivation was not Hernandez’s only problem in early 1983. He was having issues in his first marriage, which eventually ended in divorce. His relationship with Cardinals manager Whitey Herzog was deteriorating because of what Herzog felt were attitude and effort issues.

“I’ll admit that my attitude, which was criticized by Whitey, I think there’s a little bit of merit to it,” said Hernandez, who added that he disagreed with the notion that he didn’t run out grounders. “I was just trying to get my way through it.”

Hernandez also had been using cocaine for much of the early 1980s. That didn’t become public knowledge until the Pittsburgh drug trials of 1985, when he testified before a federal grand jury.

“It was something I regret, something I’m not proud of,” Hernandez says now, reiterating a sentiment he expressed on the stand then. “It affected a lot of people, my kids. And it affected me very negatively.”

Hernandez stopped using after Cardinals teammate Lonnie Smith, who during the 1985 trial testified to using cocaine with him, wandered into the clubhouse one day “basically strung out and couldn’t play, and all the [expletive] hit the fan,” he said.

The Cardinals shipped Hernandez to New York a week later.

The trade

For a man who would become a franchise building block in the coming years, the Mets gave up only two relief pitchers, Neil Allen and Rick Ownbey, on the day of the trade deadline.

Hernandez was disappointed but not surprised to be traded. Having grown up a Cardinals fan, he had hoped to play his entire career for them. He suspected they wanted to get something for him before he became a free agent after the 1984 season, because they didn’t want to pay up.

But to be dealt to the lowly Mets? That is what shocked him. He was going from the defending champs to a club that hadn’t had a winning season since 1976.

“I’ve talked with Keith and he was very subdued,” general manager Frank Cashen said right after the trade. “But he says he’s in fine shape and then asked when and where he should report.”

Hernandez briefly considered retiring.

“That’s acting on emotion. I’m an emotional guy,” he said. “I’m kind of a compulsive, impulsive personality, which I’ve learned to keep a tighter rein on. But it’s who I am. I was purely reacting on emotion, on hurt, on the pain of being traded, going to the Mets, who were a last-place team. It was just a very unsettling second half of the season in ’83. It was just a tough year for me.”

A comedic aside: Upon reading that Hernandez was less than happy about the trade, longtime Mets media relations boss Jay Horwitz wanted to make a good first impression. When Hernandez was set to meet up with the team in Montreal, Horwitz rented a limo to pick him up at the airport — and went to the wrong gate. Hernandez, oblivious to the arrangement, took a taxi. Horwitz rode to the ballpark in the limo.

Said Horwitz, “He adjusted pretty well for not wanting to come here.”

The adjustment

The 1983 Mets were bad. They finished 68-94, including 46-58 after Hernandez joined them.

After the season, Cashen offered to trade Hernandez but also noted the talent they had on the horizon. Darryl Strawberry had just been named National League Rookie of the Year. Ron Darling debuted toward the end of the season. A teenager named Dwight Gooden was on the way.

“And I was sitting there going, ‘Yeah, yeah, yeah, yeah, yeah. You guys are horrible. Mets just stink. Ever since you traded [Tom] Seaver, you’ve been awful,’  ” Hernandez recalled. “He knew what he had. I didn’t.”

Encouraged to stay by his father, John, Hernandez signed a five-year, $8.4 million extension in February 1984, passing on the chance to be a free agent at the end of the year. His average annual salary of $1.68 million was one of the highest in the game. That deal included $3.4 million in deferred payments that Hernandez still receives annually.

Then-president, now-CEO Fred Wilpon said at the time: “Keith, it’s a pleasure to pay the money.”

The ensuing spring training, Hernandez said, was “like a blood transfusion.”

“After around two weeks of spring training, I realized there was a gold mine here on the roster,” he said. “It just totally excited me.”

The rest is history. The Mets won the World Series in 1986, their most recent championship. He became the organization’s first-ever captain in 1987. He won six more Gold Gloves — his 11 total are the most of any first baseman — and went to three more All-Star Games.

He worked up the confidence to kiss Elaine Benes in 1992. He started as an analyst for SNY’s Mets broadcasts at its inception in 2006, endearing him to a generation of fans who never saw him play.

Along the way, he made up with Herzog, whom he has seen periodically at Cardinals events through the decades. And when he visits St. Louis, Hernandez gets a warm reception, which makes him feel bad, still, about how things ended, especially the part about doing drugs while with the Cardinals.

“When I go to St. Louis, people are very, very nice to me,” Hernandez said. “But I still feel kind of ashamed of what I did. I feel uncomfortable going there. I’m there today and everybody is so nice as if nothing had ever happened. It just kind of makes me feel guilty about that. But you can’t wipe out the past. It is what it is.”

During one of those Cardinals dinners, according to Hernandez, Herzog said that moving him was the worst trade he ever made.

“Whitey told me one time, ‘I did you the biggest favor in the world, trading you to New York. Look what it did for you,’ ” Hernandez said. “And he’s got a point.”

Keith Hernandez with Mets

G AVG OPS HR RBI WAR

1983 95 .306 .858 9 37 4.4

1984 154 ,311 ,859 15 94 6.3

1985 158 .309 .814 10 91 5.1

1986 149 .310 .859 13 83 5.5

1987 154 .290 .813 13 83 3.4

1988 95 .276 .750 11 55 2.2

1989 75 .233 .649 4 19 -0.2

Gold Glove 1983-1988

All-Star 1984, 1986, 1987

MVP voting: 2nd in 1984, 8th in 1985, 4th in 1986