NEW YORK — The New York Rangers understood the task.

For one game at least, they stayed on it for 60 minutes.

“It wasn’t perfect by any stretch, but I thought our intentions were in the right place and as a result it was a much lower-event game,” Rangers coach Mike Sullivan said after a slump-busting 3-2 win against the St. Louis Blues at Madison Square Garden on Monday. “We weren’t trading chance for chance and opening the game up and giving a ridiculous amount of high-quality looks. If you play the game the right way you can create your offense through your defense.”

The Rangers were not doing that in the previous four games before the Blues rolled into town Monday.

It landed them in a hole that will take some digging to get out of.

The Rangers lost four consecutive games in regulation before winning against St. Louis. It started with a 2-1 loss to the Detroit Red Wings at home on Nov. 16, when they were outshot 42-19.

It bled into three straight struggles on a western road trip last week, losing 3-2 to the Vegas Golden Knights on Tuesday, 6-3 to the Colorado Avalanche on Thursday and 3-2 to the Utah Mammoth on Saturday.

They had built up some good vibes with three straight wins from Nov. 10-15, including, finally, their first home win. They made good on some of the chances they hadn’t been scoring on earlier and it should have fueled their confidence to stick with it and good things will happen.

But that didn’t happen. Instead, the Rangers went the wrong way.

They were outskated and outplayed in the four straight losses. The games were close in score only because of elite goaltending from Igor Shesterkin and Jonathan Quick, who combined to make 123 saves in the four games.

The Rangers generated only 79 shots on goal.

“We use the phrase with the guys all the time, chasing offense,” Sullivan said. “When you chase offense sometimes it turns into a high-risk, reckless game and it’s hard to win that way. We talk to them a lot about just taking what the game gives them. When there are opportunities to make plays we certainly don’t want to take the stick out of their hands. We want them to act on their instincts and trust their instincts. But there’s also an element of discipline in taking care of the puck in the critical areas of the rink. I think it’s an important aspect of being hard to play against.

“You know, sometimes you see NFL quarterbacks throw the ball into the stands. There’s a reason for it. I think the same thing as far as managing the puck in the critical areas of the rink. If we’re making high-risk plays in the wrong areas of the rink that’s when you can feed an opponent’s transition game. I thought the last week or so… I think we had tendency to do that and I don’t think it helped us. No. 1, we didn’t get any more offense out of it, and we certainly gave up a lot more. That’s the conversation that we had with the guys the last couple of days.”