At a coronavirus-task-force briefing at the beginning of April, White House adviser Jared Kushner explained the approach that would — as events proved — get the country through its ventilator crisis.

The media relentlessly pilloried and mocked him, distorting his words in the process.

Kushner said at one point that states shouldn’t be drawing on the federal stockpile just to hold ventilators in their own reserves (the administration was worried about ventilators sent to New York state not making it to hard-pressed hospitals in the Big Apple).

This led to a flurry of media criticism alleging that Kushner wanted to hoard the federal ventilator stockpile. In a piece for The New Yorker, Susan Glasser predicted that the briefing would “surely go down as one of the ­administration’s most callous performances.”

Actually, the emphasis on data and shrewd allocation that Kushner discussed at the April 2 briefing has clearly worked.

At the outset, the country was looking at a daunting, perhaps impossible challenge. A chilling briefing at the Federal Emergency Management Agency early on posited that the United States could be short 130,000 ventilators by April 1. The federal government had about 16,000 ventilators on hand in its stockpile and several thousand more from Veterans Affairs and the Department of Defense.

A couple of insights drove the administration’s effort to get its arms around the problem.

Officials realized, as one White House adviser puts it, that there was “too much guesstimating” ­going on. Many governors didn’t know how many ventilators their states had and were acting on the normal impulse to have more than enough, just in case.

The administration created a data team. It used hospital billings to estimate how many ventilators were in each state and how many were being utilized, so it didn’t have to depend on perhaps panicky, poorly informed requests from states.

Another important realization was that FEMA could pull off just-in-time delivery. This created a lot of flexibility. The administration could wait to see how things ­really played out rather than making decisions based on projections weeks in the future.

The media portrayed it as a failure every time the administration gave a state a fraction of its ­request, but this was a key element of the strategy.

If the administration had tried to meet New York’s initial estimated need for 40,000 additional ventilators, for instance, everything would have gone out the door — and for no good reason.

Another insight was that most ventilators out in the country weren’t being used, since virus hotspots are geographically limited. That meant there was a tremendous capacity to be tapped. This led to the Dynamic Ventilator Reserve. States and hospitals with a safe margin of ventilators not in use could lend them to places that needed them.

The lubricant for the system was a federal guarantee that a hospital lending a ventilator would get a replacement in 24 or 48 hours if it turned out that it needed it back. This removed the fear and the risk of giving up ventilators.

To add to the nation’s overall supply, FEMA acted quickly — much faster than is possible in the regular process — to get so-called notifications to purchase to ventilator manufacturers, so they could start work and hold their inventory, which ­ensured it wasn’t lost to foreign countries. The Defense Production Act was invoked with General Motors to get production moving as quickly as possible, not backloaded later in the summer.

Last year, according to administration figures, the country produced 30,000 ventilators. This year, it’s going to produce something on the order of 200,000, and they are already coming in.

“The balance now is growing daily,” the White House adviser says of the federal stockpile. “We are going to be swimming in ventilators.”

By any measure, that’s a success, certainly compared with where we thought we would be less than a month ago. If the media weren’t so devoted to gotcha idiocy, more people might know about it.

Twitter: @RichLowry