A sty is a small lump or 'pimple' on your upper or lower eyelid that rubs on your eye and creates discomfort. Often you will notice that you eye is itchy and irritable for a couple of days before you notice the lump arise. They will be very tiny and hard to notice so require close inspection to identify.
Sties are caused by infections of the eyelash follicle and/or the oil gland. This can come from a variety of sources – from small particles such as saw dust (or regular dust) which blocks the gland/follicle, or from air born bacteria. The swelling that creates the tiny pimple is your immune system's reaction to try and rid itself of the infection. To avoid a sty then, you can use goggles whenever plastering or doing woodwork, and can wash your eyes regularly. Of course this won't always be effective and sometimes you will need to deal with your sty after it arises.
The most effective way to help treat a sty and prevent discomfort then is to use warm pressure. A great way to do this is with a clean flannel (it is very important that it is clean) run under hot water and pressed onto the eye (not too hot so that it burns of course). The moist warmth then will help the sty to come to a head and burst – just as it would with a wart or boil but of course you need to be more gentle around the eye. Do this regularly (around four times a day) for about a week and you should find that the sty gradually disappears. In the mean time try hard to avoid rubbing it, and never try to burst the sty or pull out the eyelash. If the sty does not clear up after about a fortnight then see a doctor who might prescribe you antibiotics.