For those who do not know, this type of vaccine (Pfizer one at least) infects some of your muscle cells so that they produce a form of the virus. The thing is, that form of the virus is not capable of reproduction, so your immune system learns to fight it. In the process of fighting it, you still get some illness symptoms, but once your muscle tissue at the injection site stops producing the neutered virus, that's it, it's done.
That's pretty close, but not completely accurate. What the Pfizer and Moderna vaccines are is a strand of synthetic messenger RNA stabilized in a nanoparticle carrier solution.
The nanoparticle carrier provides for a reliable non-reproducing, non-viral method for inserting genetic material into a cell. Because it's single-strand messenger RNA rather than dual-stranded DNA, it doesn't require the support structure of a virus to force the cell to incorporate it into the cell's own genome; cells naturally uptake mRNA as part of their protein synthesis process, so all the carrier has to do is shield the fragile mRNA until it's physically entered the cell.
In this case, the synthetic mRNA codes for a specific surface protein that the immune system uses to recognize the COVID-19 virus, allowing vaccinated cells to functionally simulate the virus and train the immune system against it without any actual viral infection. This is in contrast to the not-yet-approved AstraZeneca vaccine, which uses the more conventional technique of genetically modifying a weaker virus to express the same surface proteins as the target virus.
-----
Note that the mRNA uptake approach has been the subject of biotechnology research since as early as the 1970s, but fell out of favor (and thus funding) in the 80s-90s because there wasn't very much progress on the challenge of actually delivering the mRNA to the cell in usable form. That's where the new lipid nanoparticle tech comes in and completely changes the game.