First make sure you keep your eyes clean by closing your eyes and washing your eyelids with some mild soap and water.
Then to get rid of the stye apply a warm compress to the stye and let it sit on the stye for 10 to 15 minutes.
A warm tea bag also works great as a warm compress when placed over the stye.
Applying topical ointments to the stye or even placing cool cucumber slices over the stye can help to get rid of the stye.