What the basic mechanism of vaccine?

To allow your immune system to recognize the modified virus to prevent yourself from getting the virus yourself