Live vaccines are a thing.
You take a real living virus from a weakass viral family, jam into pieces of something really dangerous in it, and then you stab it a bit until it's even weaker and can't produce more virus, and then you give it to people and their bodies will treat it as something dangerous and remember the dangerous part while it still can't do damage.
You're basically giving the body microscopic target practice.