You have developed a hair follicle infection
. Give hot fomentations several times a day for 5 mins,with oral anti inflammatory drugs to reduce pain and swelling under you see your doctor.
Do not squeeze it.
Consult an ophthalmologist who can clean out the pus immediately( if broken) or later ( after your swelling comes down)under oral and topical antibiotic
Keep your eye lids clean with mild shampoo and cotton dipped in warm water at bed time to avoid recurrence.