The key purpose of the immune system identifies and defends the body from non-self-proteins, viruses, bacteria, fungi, parasites and other pathogens.
It protects the body from harmful substances, germs, and other foreign invaders that might cause illness to the organism.
The physical barriers of the body that is the skin and the mucus membranes prevent the penetration of the bacteria and virus that causes diseases and acts as barriers around the digestive, respiratory and as well as the genitourinary tracts of organism respectively to prevent invasion of bacteria and germs causing diseases. Eosinophils which are also natural killers of the body. They are responsible for destroying infected cells of the body rather than invading the microbe directly.
The immune system also acts as an Inflammatory Response. This is through plenty supply of blood to the injured part to cause redness and heat. Besides basophils and mast cells release histamine in response to cell injury.