Thanks for the query,
You might have developed sebaceous cyst
It is a collection of dead material under the skin.
When you press this material comes out as black debris.
Do you get such debris.
Pain can be due to infection.
Dont worry its not a dangerous condition.
Treatment is mainly surgical.
It can be removed with the wall of the cyst, through a small incision.
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 good health,