Thanks for the query.
You might have developed sebaceous cyst
It is collection of epithelial debris under the skin.
a bacterial infections might have developed in it, so you are having pus like material.
Treatment is with antibiotics followed by surgical removal.
the choice of antibiotics should be best based on culture and sensitivity tests.
With this test exact causative agent could be found out.
Please meet a dermatologist
for exact diagnosis.
Let me know if you have any other doubt.
you can ask a direct question to me on this forum, following the below link.
Wishing you a good health.