Usually they go away on their own, with patience. Sties on the outside of your eyelid eventually will rupture, discharge pus, then disappear. Inside your eyelid, the infection can be more severe. You can speed the resolution of the problem by applying hot compresses for 10 minutes a couple of times a day. Topical antibiotics usually don't help much.
Recurrence is fairly usual.
But if you're getting these regularly, it would be a good idea to look for an aggravating cause. This could be contact lenses , or exposure to irritants such as cigarette smoke. Sties are contagious and can be transmitted by finger contact. But most people don't get them, because our immune system protects the eyes pretty well. Our tears contain antibodies that check bacteria before they get a chance to settle in.