The main function of white blood cells is to ensure that pathogenic particles or foreign substances that enter the body are quickly destroyed by phagocytosis.