Contrary to popular belief, the coronavirus vaccine was not created in a few months.
When the global pandemic hit in 2019, a lot of government money was spent to get pharmaceutical companies to work on this vaccine and to put all of their scientists on it around the clock. That helped speed everything up to get the vaccine finished in 2020.