What is the function of white blood cells?

White blood cells only make up about 1 percent of blood, but their small number belies their immense importance.
White blood cells play a vital role in the body’s immune system—the primary defense mechanism against invading bacteria, viruses, fungi, and parasites. 
They often accomplish this goal through direct attack, which usually involves identifying the invading organism as foreign, attaching to it, and then destroying it. This process is referred to as phagocytosis.
White blood cells also produce antibodies, which are released into the circulating blood to target and attach to foreign organisms. 
After attachment, the antibody may neutralize the organism, or it may elicit help from other immune system cells to destroy the foreign substance.
There are several varieties of white blood cells, including neutrophils, monocytes, and lymphocytes, all of which interact with one another and with plasma proteins and other cell types to form the complex and highly effective immune system.