It's probably a sty.
A sty (hordeolum) is a red, painful lump on the edge or inside of your eyelid that may look like a boil or a pimple. It's usually filled with pus. As it swells in size, the sty may make it difficult for you to see clearly because you can't fully open your eye.
More than one sty can occur at a time, leading to an inflammation at the margin or edge of your eyelid — a condition known as blepharitis. Fortunately, most sties disappear in just a few days. In the meantime, you can sometimes relieve the pain or discomfort of a sty with simple self-care treatments.
Self-care
Don't squeeze a sty or try to remove the pus prematurely. To relieve the pain and help a sty come to a point sooner, soak a clean cloth in warm water, wring it out and then apply it as a compress to your eyelid for 10 minutes, four times a day. Once the sty bursts on its own, keep the area clean and dry. To prevent recurrent infections, keep your hands away from your eyes and practice good hand washing techniques. This is especially important for children, because they are prone to sties.
Treatment
If your doctor confirms that you have a sty, he or she may prescribe a topical antibiotic cream to apply to your eyelid. To treat a pus-filled sty that won't rupture or burst on its own, your doctor or ophthalmologist may choose to lance and drain the lump to relieve pain and pressure. If you have multiple or recurrent sties, your doctor may also prescribe antibiotics.