The pimple on your eyelid is a stye.
A stye is an inflamed oil gland near the base of your eyelashes.
Styes are red, swollen and tender bumps that appear like a boil or pimple and they are often filled with pus.
A stye is caused by bacterial infections and often from staph or staphylococcus aureus.
Styes are most common in adults than children because adults have thicker oil in their glands and they are more likely to get blocked.
Most styes go away on their own in a couple of days.
However you can help alleviate pain and speed up healing by applying a warm, damp washcloth to the eyelid for 10 to 15 minutes, 3 to 5 times a day.
If the stye doesn't go away within 1 to 2 weeks you should see a doctor.
Do not squeeze or pop the stye as it can spread the infection and make the stye worse.
Other types of eyelid bumps include Chalazion and Milia.
Milia are bumps that are caused by keratin building up under the eyelid skin.
Milia is not contagious and does not grow after appearing.
Chalazion is a swollen and pain free bump which often goes away on it's own within a few weeks to a few months.