What is the purpose of red and white blood cells?

Red blood cells carry oxygen throughout the body, while white blood cells are part of the immune system and attack foreign organisms that enter the body, like bacteria.