Skin BarrierCredit:
The skin, if we think of about it hard enough, is the most vulnerable organ of the body. Because it is located externally, it is constantly exposed to harmful chemicals, bacteria, temperature changes and injuries. The skin does this in order for the internal environment to maintain homeostasis.
The Skin as a Chemical BarrierSkin chemical barriersCredit:
It is a known fact that there are a number of bacteria found in the skin. However, the secretions of the skin have a low pH, giving rise to the so-called acid mantle of the skin. This acid mantle makes it difficult for these bacteria to multiply to alarming numbers. 
The secretions of the skin mentioned include the sweat and sebum. Melanin is also included when talking about the skin as a chemical barrier. Just to recall, the secreted sweat contains antibodies and dermicidin, a microbe-killing peptide. The oily secretion or sebum also has bactericidal action. Harmful rays from the sun or other sources that release UV rays are shielded by the melanin in our skin.
On top of these defences, the skin cells itself produce human defensin which is a natural antibiotic. It acts like a bully, literally punching and creating holes in the bacteria, making them ineffective. When the skin is cut or is wounded, the skin doubles the production of cathelicidins and releases them in large quantities to cover the injured part, forming a protective coat that is especially effective against group A streptococcus bacteria.
The Skin as a Physical BarrierPhysical barriers to infectionCredit:
The skin is a continuous organ, covering the entire human body. Some parts of the body have smooth and soft skin; other parts contain hard keratinized cells. With this diversity, the skin is highly adaptive and is able to compromise. Parts of the body with thinner layer of skin provide great agility and flexibility. On the other hand, part where the skin is thick is less agile and provides flexibility to a lesser degree but it is more impenetrable. 
Coupled with the acid mantle, the two constitutes the frontline defence of the skin against bacterial invasion. The glycolipids present in the epidermis acts in two ways, that is it prevents the loss from and also upon entry of water and water-soluble substances through the skin. 
The Skin as a Biological BarrierBiological skin barrierCredit:
The human skin employs the Langerhans’ cells, macrophages and the DNA itself as the ultimate line of defence. The Langerhans’ cells, also known as the dendritic cells found in the epidermis are part of the immune system. The soldiers of the immune system are always ready to ward off foreign bodies that enter the body, however, they need the necessary stimuli for their defensive stance to kick in. This is where the Langerhans’ cells play an important role. They antigens or foreign bodies are captured by these cells and are presented to the lymphocytes. By then, the lymphocytes send signal to the control centre of the immune system, activating the immune response.
When highly specialized bacteria and viruses do manage to penetrate the epidermis layer of the skin, they are met with the dermal macrophages. They function similarly to that of the Langerhans’ cells.
 Use skin barrier creamCredit:
The last line of defence of the body when it comes to harmful rays is the DNA itself. The melanin is already an effective sunscreen but in instances where UV rays escape the guard of melanin, the electrons in the DNA catches these free UV rays and then delivers it to the nuclei. In the nuclei, the collected UV rays dissipate into harmless heat.