IT could be infected sebaceous cyst
It occurs in relation to hair.
Please use antibiotics and anti inflammatory medicines initially .
Once the redness
and pain are subsided,it has to be removed completely by a surgeon.
If the skin is not red,you can get it removed now itself.
Wish you speedy recovery