Golden State forward Andrew Wiggins, left, shoots next to Knicks...

Golden State forward Andrew Wiggins, left, shoots next to Knicks forward Julius Randle (30) during the second half of an NBA basketball game in San Francisco, Friday, Nov. 18, 2022.  Credit: AP/Jeff Chiu

SAN FRANCISCO — The Knicks spent the requisite time preparing for this game and came into it convinced that if they played together, hard and smart, the way they did to win the first two games on this western trip, they could do anything.

But in that preparation, there is no way to mimic what they would face when Stephen Curry began to do the things that only he and Golden State can do.

With the Knicks’ defense in a constant state of scrambling, switching and chasing a never-ending weave of cutters and unselfish passers, there would be times like this one: 7-1 center Isaiah Hartenstein found himself isolated defensively against Curry.

Curry caught a pass, attacked Hartenstein on the baseline and suddenly slipped the ball behind his back from left to right and flipped in an effortless layup — one of so many highlights as Golden State earned a 111-101 victory at Chase Center.

Cam Reddish suffered a groin strain during the game and was left wondering if it was from chasing Curry.

“They were just playing a little faster than us,’’ Jalen Brunson said. “We kind of eased our way into the game. I eased our way into the game. You can’t give a team like that any room at all. You’ve got to be ready to go.

“[They are] very hard to guard. I mean, they’ve won four out of the last eight titles. It’s very self-explanatory. You’ve got to be ready to go.’’

The Knicks fought an uphill battle all night long and could at least cling to that — the notion that even on a night when nothing seemed to be going their way, they kept fighting. And that is what they have tried to do to change their fortunes.

Sticking together made perfect sense, given that the Knicks did little else right. The shooting was terrible. Turnovers were nearly as frequent as made baskets. But still, they cut the deficit to 100-90 midway through the fourth quarter after five straight points by Jericho Sims.

Golden State then did what it had done all night, passing and cutting until the ball found Klay Thompson all alone for a three-pointer. In just over a minute, the lead was back up to 16 and the fans were beginning to stream for the exits.

Curry had 24 points and 10 assists and Thompson and Andrew Wiggins added 20 points each for Golden State (7-9). Julius Randle scored 20 points and RJ Barrett had 18 for the Knicks (8-8). Sims had 10 points, 10 rebounds and three blocked shots off the bench.

Randle is very ill, Barrett has been sick and something is spreading through the team. Does that make playing Golden State a bad matchup? “A recipe for disaster,’’ Randle said. He laughed. “Yeah, a recipe for disaster.’’

After the back-to-back wins in the high elevation of Salt Lake City and Denver, games that are supposed to challenge visiting teams, the Knicks appeared to be running in mud early. Golden State got out in transition and Thompson scored 11 points as his team took a 35-19 lead.

The Knicks fell behind by 22 points in the first half and seemed fortunate to be down by only that much. They missed 21 of 26 shots and went 0-for-10 from three-point range to start the game before Barrett finally hit a three, snapping his own personal streak of 19 straight misses from beyond the arc. The Knicks finished the half by shooting 6-for-8 from three-point range and trailed 61-50 at intermission.

That sort of team-oriented feeling, which could have originated during Sunday night’s players-only dinner, may have contributed to a reversal of the struggles the team endured before the trip. The dinner, which even coach Tom Thibodeau dismissed with the reality that change had to come through actions, not words, may have served as a starting point.

“It’s the faith we have in each other,” Barrett said. “This is what we’ve got. Everybody is locked in, everybody is together. You see many different people play well. That’s what a team is really about, collectively, all of us. Especially some of the tough plays guys made the last game, that’s how you win.”

And now, tied together on the road, they may be on their way to finding their form.

“For sure, you definitely get closer during a road trip,” Barrett said. “You see everybody all day every day. Lot of fun, a lot of laughs. Just staying together. Stuff like [the dinner], it helps. You’ve seen it. For the team, for everybody, staying on the same page. It’s huge.

“Like I said, we’re all we got. We just ride with that. Try to figure it out and get some wins. Compete. Like I said, all due respect to everyone out there, but we’re the only ones that are going out there doing it. So we got to trust each other.”

Newsday LogoSUBSCRIBEUnlimited Digital AccessOnly 25¢for 5 months