From the description of your symptoms, you may have a sty. This is a small collection of pus, a tiny bacterial abscess, which forms near eyelashes in blocked oil glands. A sty will usually drain on its own within a few days, relieving symptoms. While waiting for this to happen, apply warm water to a clean washcloth and use this as a compress on the sty several times each day. Avoid the temptation to squeeze the sty. Once it drains, wash the eyelid frequently.
Some people get these repeatedly; a prescription eyedrop or ointment may be helpful to prevent recurrence.
Would you like more information about eye conditions that may cause a discharge?