My neighbors youngest son had a sty on his eye lid. A sty is a plugged-up oil gland or sweat pore on your eyelid. I remember what a doctor once recommended for my son and told them about it.
Place a compress, simply a clean cloth soaked in hot water. (Be careful and make sure it isn't too hot.) Place it over the sty and leave it there for about 10 minutes. Do this 4 or 5 times a day. This should open the blocked gland. If it doesn't recede after 3 or 4 days, you should go see your eyecare doctor. This method worked for the youngster.
The way to prevention is good old soap and water. This will reduce chances of developing a sty.
Sorry...I don't like the 'invasiveness' of the sty that long. I just hold my eyelid that's infected while I take a matchbook cover (or credit/debit card) and scrape over the sty to release it. Of course you must be careful not to scratch the eyeball. Works every time for me.