A lot like the flu shot, they make educated predictions about what strains will circulate before it happens. And we don't spend 15 years testing it, we know the framework for making flu shots is safe.
Sounds crazy, right? Because of SARS and MERS, public health people knew it was a matter of time until another coronavirus went pandemic. They thought it would arrive in Chicago instead of Seattle but got the rest right.
It took 2 days for Moderna to engineer a molecule that's 95% effective against the disease. Thanks to all the research during SARS1. That's how they knew to target the spike protein.
Scientists have a very good idea which virus families have the potential to become pandemic. Like the flu, if we have the vaccine on the shelf when the virus emerges, the best matching shot may (or may not) need tweaking if it's a novel strain, and for the most part only the changes will need to be tested, instead of the whole thing. Like the flu shot.
We can do Phase 1 & 2 testing ahead of time. We can even do some limited Phase 3 trials, verifying that the shot makes people produce antibodies. More efficacy testing would be needed it the virus became a problem, compared to starting from scratch.
This would cost about a millionth of what covid has so far. We could have jabbed our way to herd immunity by last summer. Almost 3 million have died so far worldwide.
This isn't my idea, it was cooked up by people smarter than me who work in public health.