It is sebaceous cyst which is getting again and again infected. When you have pain in the lesion that means that it is inflamed. Otherwise it would be a asymptomatic nodule which you can feel and in the centre of it there would be a white circle.
Next Steps
when inflamed we avoid any surgical procedure.
but ultimately the permanent cure would be surgical.
We both are Dermatologist, in order to help you , kindly come online consultation for detailed history and video interaction.