Vaccines are a way to stimulate your body’s natural defenses and make your immune system stronger. By introducing a safe, inactive replica of a portion of the virus’ structure, vaccines fool your immune system into producing antibodies to protect you without exposing you to COVID-19.
The Moderna and Pfizer vaccines do not contain a live virus. The Johnson & Johnson vaccine does contain a modified virus, but it is not the virus that causes COVID-19.
Something to note, vaccines are not a cure. They don’t guarantee that you won’t be infected if you are exposed to the virus. However, the COVID-19 vaccines have proven effective in greatly reducing your chances of catching the disease and, more importantly, getting seriously ill, needing hospitalization, or worse.
SOURCES: https://vk.ovg.ox.ac.uk/vk/how-do-vaccines-work (University of Oxford)