Virus and Bacteria
Viruses and bacteria that cause illnesses are called pathogens. When a pathogen infects us our immune system uses white blood cells to fight the infection by killing the pathogens and the cells they infect. One way they fight is to make antibodies. These protein structures act like heat seeking missles that recognize specfic cells or viruses and attack them if they come close.
When you are infected your body produces large numbers of antibodies and special "memory" white blood cells remember how they are made in case you ever need them for the same pathogen. This is why you only get some viruses once, for example chicken pox. Once you have the illness your memory cells remember how to make the antibodies to destroy that virus.
A vaccination is a method to trick the body into making antibodies without you actually getting sick. A vaccination is either a killed virus or a live virus that has been made safe for your body. When the vaccination is injected into your blood, your white blood cells make antibodies and now you can fight off the real virus if you ever catch it.