SAN JOSE – The San Jose Sharks have been told time and again in recent weeks about the ways they need to play down the stretch as each playoff-caliber team they face ratchets up the intensity to prepare for the postseason.

Play simple, direct, and north-south. Put pucks behind the defense and go to work. Test goalies.

Sometimes it’s sunk in for the Sharks. Other times, it seems to go in one ear and out the other. And now, as they get set to face the Anaheim Ducks on Thursday night, the Sharks’ playoff hopes are hanging by a thread.

The Sharks on Wednesday took too many penalties, lacked desperation, and had no answer for Edmonton Oilers captain Connor McDavid, as he recorded his 15th career hat trick and finished with five points to hand San Jose a potentially devastating 5-2 loss.

The Sharks’ penalty kill went 0-for-3 on Wednesday and in 22 games since the Olympic break, now ranks 29th in the NHL at 72.1%. Over that same time, the Sharks and their maligned defense corps have allowed 3.68 goals per game, tied for the fourth-most in the league.

But perhaps the most frustrating part for the Sharks was that, at least on offense, they did the opposite of what they talked about before the game.

Wanting to play a no-nonsense style and get more pucks to the net, the Sharks instead finished with just 11 shot attempts and three shots on net in the first period as they fell behind 2-1. None of the three shots on goal came at even strength.

By the time the game ended and a good percentage of the announced crowd of 15,683 had already filed out of SAP Center, the Sharks had managed just 14 shots on the Oilers’ goalies, including four in the third period.

Give some credit to the Oilers, whose improvements on defense have been a big reason why they’ve risen to the top of the Pacific Division. But the Sharks feel, and rightfully so, that they’re capable of a lot more than they showed in what could have been their penultimate home game of the season.

“Just this time of year, you’ve got to play simple, direct hockey, in the offensive zone, especially,” Sharks coach Ryan Warsofsky said. “And we can’t seem to grasp that consistently enough right now.”

The Sharks did a lot of good things in wins over the St. Louis Blues and Ducks to open the homestand and revitalize their postseason hopes. They also took care of business against the non-playoff-contending Toronto Maple Leafs and Chicago Blackhawks, collecting four more points.

When it came to playing more quality opponents, such as the Oilers and Predators, though, the Sharks’ shortcomings were exposed.

The Sharks were tied with the Predators in the third period of Saturday’s game at the Tank. Then the Sharks lost defensive-zone coverage on a goal by Ryan O’Reilly and allowed a shorthanded goal to Erik Haula, in what became a 6-3 loss that’s looming even larger now.

On Wednesday, the Sharks never really gave themselves a chance.

“We have to be better,” said Sharks center Macklin Celebrini, who scored the game’s opening goal at the 4:27 mark of the first period. “We didn’t shoot the puck enough. I took a bad penalty (in the first period), and they scored on it, and we just need to be better.

“We need to kind of come out a little hotter. We need to shoot pucks. We passed up a lot of really good chances, and we’ve got to play hard on their top guys. We can’t let them kind of just dance around.”

That’s what McDavid did, anyway.

Besides his first-period power-play goal, McDavid added two even-strength goals — his first on a dazzling individual effort at the 5:53 mark after he skated around Sharks defenseman Nick Leddy and eluded a poke check from goalie Alex Nedeljkovic. His second came after a Sharks turnover, as his pass intended for Jack Roslovic went off the stick and past Nedeljkovic.

“He’s the best player in the league, and he’s also the fastest, so if you don’t really slow him down or get in his way, he’s just gonna skate by you,” Celebrini said. “It’s as simple as that. We’ve seen it his whole career. I loved watching it when I was a fan, but super frustrating when you play against it.”

McDavid returned the compliment to Celebrini, his Canadian Olympic teammate, who now has 108 points, six shy of Joe Thornton’s single-season Sharks record.

“There are a lot of great players in this league,” McDavid said. “(Celebrini is) right up there at the very, very top. I prefer him playing on my left side at the Olympics than going against him.”

The Sharks go into their game against the Ducks with 81 points, three points behind the Nashville Predators for the second wild card spot in the Western Conference, with one game in hand. They’re also one point back of the Los Angeles Kings, with both teams having five games remaining.

So, the math isn’t good, and neither are the percentages. After Wednesday’s loss, the Sharks had just a 9.9% chance of reaching the playoffs, per MoneyPuck.com.

Time is running out on a team that few believed would be in this position when the season began. At this point, it feels like the Sharks almost have to run the table to get in, which, given what happened on Wednesday, might be too much to ask.

“It is what it is. It’s done with,” Nedeljkovic, who stopped 21 of 26 shots, said of Wednesday’s game. “Now we’ve got a big one (Thursday) obviously. We’re still in it. We just got to go in and take care of business.”