White blood cells have 3 lines of attack:
Consuming them- White blood cells can engulf foreign cells and digest them
Producing anti-bodies- Every invading cell has unique molecules called antigens on its surface
When your white blood cells come across a foreign antigens , they will start to produce proteins called antibodies to lock onto and kill the invading cells. The antibodies produced are specific to the type of antigen - They wont lock onto any others
Antibodies are then produces rapidly and carried around the body to kill all similar bacteria or viruses
If the person is infected with the same pathogen again the white blood cells will rapidly produce antibodies to kill it - the person is naturally immune to the pathogen and wont get ill.
Producing Antitoxins- These counteract toxins produced by the invading bacteria.