Special immune cells called 'memory T cells' remember what bugs or viruses have made you sick before to help protect against repeated infection.
These memory T cells remain in the body for a very long time, for example a memory T cell against smallpox was found to be 75 years old.