It might be a 'Stye'.It develops when the gland of the edge of the eyelid got infected. Most of them cure by themselves,but it may take time.
If it really hurts then you should depend on antibiotics.
For relief,you can apply hot compress for 5 or 10 minutes 2 or 3 times a day.
And not that do not rub/pop the pimple.