
When that occur a comedo which is a sebaceous follicle plugged with sebum, dead cells from inside the sebaceous follicle, tiny hairs, and sometimes bacteria, is formed, initially as "microcomedone". The picture below is a "microcomedone":

Microcomedones become skin blemishes called comedones--either a whitehead or a blackhead.

Whitehead - When the trapped sebum and bacteria stay below the skin surface, a whitehead is formed.

Blackhead
A blackhead occurs when the trapped sebum and bacteria partially open allowing some of the content to slowly drain to the surface. The "black" color is due to a reaction of the skin's own pigment, melanin, reacting with the oxygen in the air. A blackhead tends to be a stable structure, and can often take a long time to clear.
Neither blackheads nor whiteheads should be squeezed or picked open, unless extracted by a dermatologist under sterile conditions. Tissue injured by squeezing or picking can become infected by staphylococci, streptococci and other skin bacteria.