^ Some people are prone to them and need to be very vigilant in eyelid cleanliness.
The best thing you can do is pick up some of this
Use it every day to wash your eyelids, especially along the margins (the flat part that presses against the eye). They are no-tears so you can get it in the eye without stinging. You should do a hot-compress and then use the thera-lid on the eye afterwards.
You may also have a mild Meibomian Gland disorder (DONT GOOGLE) that requires eye-lid massage on a regular basis.
Sometimes you just have to do what you described if necessary as they may happen from time to time.