A few weeks ago, the Mets were on life support. Now they are more dangerous than ever with pitching and hitting finally in sync.

They believe the hard lessons learned will carry them into October.

For the first time in a long time, it doesn’t seem like just talk.

“If we stay healthy … If our arms come together … If Cespedes comes back … ’’

No ifs this time around. Just do it. Bring on the Nationals.

Once they’ve been through hellfire as a team and come through it together, there is a much different attitude, as evidenced by these words from reliever Robert Gsellman:

“We’re excited to play the Nationals. It’s going to be a big series, a fun series,’’ Gsellman told The Post of the three-game encounter at Citi Field that begins Friday night. “We all have each other’s backs right now, playing well. We’re all on the same page. We just have to keep it rolling.

“What doesn’t kill you makes you stronger.’’

Acquiring Marcus Stroman, who will pitch Friday night at home as a Met for the first time, gave the Mets a mental lift, along with keeping Noah Syndergaard and Zack Wheeler. Stroman will be opposed by Washington’s Stephen Strasburg.

“We’re finally putting it together,’’ said Wheeler, who told me weeks ago in Miami that the Mets were going to follow the template set by the Nationals — who were 19-31 through 50 games and now lead the NL wild-card race — of getting back into the race.

The Mets have done exactly that.

“Throughout the season, the pitching was doing well or the hitting was doing well and the other one wasn’t,’’ Wheeler said. “Everybody is doing their part now — hitting, pitching, guys come off the bench, that type of stuff, so it’s finally coming together.’’

It’s always about coming together.

“Finally,’’ is what Mickey Callaway said of the rejuvenation. “I’ve said all along: If we can all get it together at the same time, we’ll be good. It’s time to make a good run.’’

It’s well past time.

The Mets have let down their fans and themselves for so long that most fans are pinching themselves over this 19-6 start to the second half. Is this another Mets mirage?

The Mets still have to prove they can beat the good teams. They are 7-11 against the Dodgers, Braves and Cubs.

There is a long way to go, but at least they are back in the fight.

Edwin Diaz began to sabotage that record with his LA collapse in late May, but now with the emergence of Seth Lugo — who has not given up a run since June 29 against the Braves — the Mets have coverage at the back end of games. The message Callaway sent that Lugo would close games as well as Diaz is vital. It showed the players that performance counts. Diaz is still a combustible reliever with five runs given up over his last five outings.

“His fastball is straight,’’ said one scout.

Straight in, straight out.

The Mets were 28th in bullpen ERA prior to the All-Star Game and are second since the All-Star break. They have a winning formula for a change.

The hitting has come around because Jeff McNeil has exerted his hitter’s will on the lineup. That has taken heat off Pete Alonso, and the slugger appears to be back in the groove after going through a typical rookie adjustment period. Alonso simply slowed things down to get back to where he was at with 37 home runs.

And the starters have come around much like they did in the second half of last season. They needed something to pitch for, and now they entered Thursday only half a game out of the wild card. After the Nationals, it is a visit to the Braves, so this is statement time.

The season started with Brodie Van Wagenen’s proclamation: Come get us. Then came the mea culpa less than a month ago: They came and got us.

Now BVW might offer: We’re coming to get you.

That is the challenge for these Mets over the next six games, three at home, three in Atlanta.

The run to get back to three games over .500 has to be validated with a solid performance against the Nationals and Braves.

That is the challenge. For a change this time of year the Mets aren’t dead.

They insist they are stronger.