Welcome to Healthcare Magic
You could be having a meibomian gland inflammation
. You will need to get a thorough checkup from your Ophtalmologist for proper diagnosis and management. If it is a Chalazion usually Surgery will cure it. As of now you can apply warm compress to relieve the pain and also take pain killers under medical supervision only.