Vaccines contain dead bacteria to get ready to fight the real bacteria/virus. Imagine like that every time you take a vaccine the body makes a blueprint of it. Then, when the virus/bacteria comes, the body knows the bacteria/virus because they made a blueprint. Now, the flu vaccine is different because they change very much. They change every year, so that is why you take flu vaccines yearly.