It seems from the history that you are sufferring from acute inflammatory lesion of one of the glands of the eyelids like external hordeolum or internal hordeolum.
The treatment is by hot compress and oral antibiotics
and oral analgesic
Recurrent inflammation sare seen in individuals with refractive error
, uncontrolled diabetes
I advice you to consult your eye doctor to look for underlying predisposing conditions and treatment accordingly.