FARMINGDALE, N.Y. — Brooks Koepka didn’t win the PGA Championship so much as he weathered it. The North Atlantic gusts whipped across Bethpage Black and rattled Koepka’s shirt like a sail. As the breezes toyed with his clothes, and his golf ball, you kept waiting for the ultimate disaster, the dreaded double bogey that would sink him. But he never allowed it. Somehow Koepka outmuscled all that wind and imminent catastrophe.

When it all seemed to be leaking away with four straight bogeys, “I never thought about failing,” said Koepka, who at 29 has established himself as the toughest-minded player of his generation. “I was trying my butt off. If I bogeyed all the way in, I’d still have looked at it as I tried my hardest. Sometimes that’s all you got. I guess you could have said I choked it away, but I never once thought about it.”

Bethpage Black was so severe that a flat television screen couldn’t really capture it: The precipices of its elevated tees and greens were heart-pumpingly steep, and so were the deep swales in the fairways. Thickets of trees and ankle-wrapping fescue lined its dangerously sharp doglegs. It was more than a punishing test of golf. It was a traumatizing one. As Paul Casey finished his round and went to the scoring tent, he saw a dog wearing a coat that said, “Emotional Support Animal.”

“Which is what I feel like I need after playing that golf course,” he said.

This is how hard 7,459-yard Bethpage was: Over the last two rounds, 64 competitors out of the field of 82 carded double bogeys, that ultimate humiliation for a touring pro. The course pried 6s and 7s out of the best golfers in the world in multiples, a total 196 over four days, and 41 in the final round alone. Even Jordan Spieth and Rory McIlroy each committed two apiece over the course of the tournament.

But Koepka never made one. All along, he understood better than anyone that the man who avoided the compounded errors on this course was the one who had the likeliest chance of winning. There were hazards everywhere for Koepka, not the least of which was Dustin Johnson, who just kept on coming like that strong wind, with his 69. But Koepka time and again was able to cut trouble down to size with a solid timely shot and that unwavering putter of his.

“I forget who told me this, but someone, a long time ago, said it takes two holes to recover from a double and one hole from a bogey,” Koepka said earlier in the week. “You know, you can get into trouble, and you just need to minimize the damage that you are about to cause. You know, you want to make sure — you’ve got to look at par, and if sometimes bogeys — bogeys aren’t going to kill you in a major championship.”

In assessing how Koepka has been able to win four majors in the space of 23 months, start with this: He has the ability to impose a calming, rational thought on himself when he needs one under pressure. And to command his arms and legs to obey that thought when he is in trouble.

Four straight bogeys were their own kind of trouble. They came at the worst possible time, when Johnson was closing in with a rash of three birdies in six holes as he made the turn. Suddenly Koepka wasn’t trying to slam the door, he was just trying to avoid a historic humiliation. No one had ever lost a seven-stroke lead going into the final round of a major.

The wind manhandled him. He drove way off line into the fescue at the par-5 13th hole and tried to gouge his way out with a divot the size of a pork chop, but the wind spat his approach back down. Bogey. At the par-3 14th, the wind carried his iron shot 30 yards over the green. With each gust and setback, he told himself the same thing: “How do I make sure I make bogey at worst.”

He stepped to the 15th tee. Up ahead came the roar from a Johnson birdie, and the New York crowd starting whooping and jeering and chanting Johnson’s name. “What do you expect, when you’re half-choking it away?” Koepka said.

That was the moment when Koepka could have lost it. That was when so many other players would have let it bleed away. All over the course, other players were struggling to hold themselves together in the wind. In fact, Koepka’s four bogeys in a row weren’t abnormal in the context of what those gusts were doing to others. Xander Schauffele had five bogeys in a row. So did Jazz Janewattananond. Zach Johnson had four in a row. Louis Oosthuizen bogeyed five of six and had 10 on the day. Harold Varner III had three double bogeys and six bogeys. Scores were getting away from guys. Tony Finau shot 79, Tommy Fleetwood 78, Rickie Fowler and Danny Willet 77.

But standing there on the 15th, Koepka fed himself a thought. He knew that Johnson, trying to press him from behind, would probably overreach. “Guys got to push, and if you’re going to push on this golf course, you’re going to make mistakes,” he’d observed Saturday night. Now he steadied his hands and his mind by reciting a simple fact to himself:

“I got the lead, and he’s got to make something happen.”

Then he striped a tee shot straight down the middle.

And Johnson found the deep rough on the next two holes for bogeys.

“You can’t teach somebody to think the way that Brooks Koepka thinks,” Graeme McDowell said.

All week, Koepka had preached these thoughts to himself in that deadpan voice that is becoming his signature. “It’s just another day of work,” he’d said Saturday night. That day of work, as it happened, accomplished something extraordinary: the unprecedented feat of holding two PGA and two U.S. Open trophies simultaneously. And it built an already strong-minded player into one even stronger, if that’s possible. “There’s a lot of satisfaction for what happened today,” he said, with the trophy by his side. “This was, by far, the most stressful. I’m glad I’ve got this thing sitting next to me.”