On the night of May 16, 2018, Andrew Friedman, the president of baseball operations for the Los Angeles Dodgers, headed for bed in a rather depressed state. His team, which won the National League pennant the previous season and expected even more last year, had just lost in Miami for the second straight day, lousy performances that had followed getting swept by dreadful Cincinnati in a four-game series. The Dodgers were 16-26. Only one team in the National League had a worse record.

“I remember thinking, ‘Okay, maybe I’m a fool for being as positive as I’ve been,’ ” Friedman said. “The math kind of started to sink in on what it would take for us to win the division at that point. That was probably the lowest point of the year.”

Before turning in, Friedman looked at his phone. He saw a tweet — he remembers it being from the scouting service Inside Edge — that noted the last time the Dodgers were as many as 10 games under .500 that late in the season, they ended up winning the division by 11 games. Indeed, the 2013 Dodgers were 30-42 on June 21, then won 62 of their final 90 games.

“That made me feel more confident,” Friedman said Tuesday by phone. “It was like, ‘Okay, this has been done.’ It made it seem less daunting.”

That’s the point here, Washington Nationals fans. This can be done. Doesn’t mean it will be. But it can happen. So before this season goes completely awry, it’s worth noting that the 2018 Dodgers had the same record as these messy Nationals after 41 games — and they went to the World Series.

In this crucial and bleak stretch for the Nats, when such a turnaround frankly doesn’t seem possible, it’s worth wondering: How do you survive — and then thrive?

“The narrative is loud [that the season is lost], and rightfully so,” Friedman said, “and it’s just being able to tune that out and just focus on problem-solving. We were fortunate to not have any additional noise from above us. Ownership was supportive and believed in what we were saying about just the true talent level of the group. Every day was about being positive but productive and trying to figure out how to solve problems. You have to be able to know what to react to and what not to react to.”

This is easier to say on May 15, 2019, than it would have been on May 15, 2018, because we now know the outcome. But it has to be noted, too, how difficult and unlikely this turnabout was. According to the Elias Sports Bureau, just five teams in the history of the game started 16-26 or worse and qualified for the postseason. (Three more started 16-25 or worse and made the playoffs.) Last year’s Dodgers did it. But before that, the only team to start 16-26 or worse and make the playoffs in the previous 36 seasons was the 2005 Houston Astros.

It’s not likely. But you’re saying there’s a chance . . .

So here are the Nationals, beat up and flailing. What Friedman remembers those Dodgers lacking is what the Nats are lacking now: “Just consistency,” he said.

“We have to play better baseball,” Washington outfielder Adam Eaton said, and it really doesn’t need more dissection than that.

“With our guys, I tell them, ‘Hey, we got to take care of ourselves and play the game better and more consistently every day,’ ” Nationals Manager Dave Martinez said. “That’s what we need. We need to be more consistent.”

He said this Tuesday afternoon, hours before his fill-in shortstop, Wilmer Difo, failed to do more than deflect a ball up the middle, a grounder that should have been the last out of the first inning against the New York Mets. Instead, it got into center for a single, and two batters later Wilson Ramos launched a grand slam that all but sealed the outcome as the game was just getting started.

Those are the teensy moments that become gargantuan during stretches such as this. Listening to Friedman talk about his Dodgers of last season sounds something like Washington General Manager Mike Rizzo talking about his current Nats. Those Dodgers had third baseman Justin Turner, arguably their most important offensive player back then, out until the second week of May. They lost shortstop Corey Seager at the end of April. Ace Clayton Kershaw made zero starts between May 1 and May 31. Lefty Rich Hill missed time.

Sub in the names Trea Turner, Anthony Rendon, Juan Soto, Ryan Zimmerman and Matt Adams, and you’re talking about these Nats.

The guiding force for those Dodgers, even through the injuries, is something akin to what Rizzo always says about players with a positive history: They’ll eventually produce the numbers you read on the back of their baseball cards.

“Good players play well over time,” Friedman said. “It was just kind of an imperfect storm to that point where on nights that we pitched well we didn’t hit, and on nights that we hit we didn’t pitch well. In sequencing and timing, it was as off as you can ever have it, which was a lot of randomness. I think the fact that there was no panic allowed our guys to focus on the things that were productive and conducive to winning.”

So, then, can you walk into Nationals Park for Thursday’s finale against the Mets and — gulp — hope? One word of caution: Through Tuesday’s games, the Nationals had allowed 29 more runs than they had scored, the fourth-worst run differential in the NL. They have looked and felt like a bad team. Through those first 42 miserable games, last year’s Dodgers had just a minus-4 run differential. Things seemed more likely to even out.

Which they did. After that second loss to the abysmal Marlins, the Dodgers came back the next day to win the finale against Miami, then flew to Washington, where they swept the Nats. They were back to .500 by June 5. They moved into first place July 12. They went 76-45 the rest of the way, a .628 winning percentage, a 101-win pace over the final 121 games of the season (which included a tie-breaking 163rd game for the division title in Colorado, another win). They won the pennant for the second straight year.

The Dodgers survived the dark days. Are there lessons to be applied when they go through it again?

“My hope is to never go through it again,” Friedman said.

Fair enough. Right now the Dodgers, first in the National League West, aren't going through it. The Nationals are. One franchise can show the other how to navigate through this. It just has to start — now.

For more by Barry Svrluga, visit washingtonpost.com/svrluga.