Scientists have been studying and working on mRNA vaccines since before this outbreak. They were able to take what they had learned and put it into practice with the COVID-19 vaccine.
The mRNA COVID-19 vaccines have underwent and passed all the phases of testing required by the FDA, as described by this infographic from the National Institute of Health:
Even after the testing phase the vaccines are still carefully monitored.
Side effects of the vaccine (e.g. feeling tired...
The vaccine doesn't give you COVID-19 itself, it just gives you the RNA code that causes your body to produce COVID-19 spike proteins (not a live virus, not even a dead virus; just the spike proteins, which can't harm you or multiply). Your body builds up immunity (antibodies and memory cells)...
Here's an excellent article about how the Pfizer mRNA vaccine works. The Moderna vaccine is quite similar. The way it works is really neat and knowing what the vaccine is and how it functions eliminated any uncertainty I had about what was going to be put in my body...