Thank you for posting your query at DoctorSpring.com
As per your description, it looks like an infected sebaceous cyst.
Sebaceous cyst is a cystic swelling occurs in relation to hair follicle.
It got infected in your case.
Because of the infection and associated inflammation,it has become red and painful.
Usually, I will remove the swelling as a whole under anaesthesia.
So, during your appointment with your doctor, ask him to excise the swelling.
Till appointment, you should use antibiotic and anti inflammatory tablets. In course of time, it may rupture and release pus.Even then, nothing to worry. You can ask your doctor to remove the residual swelling.
You will be alright.
Hope I answered your query.
If you have any questions, I will clarify further.
Wish you good health.