Hello..Thanks for your query.
There is a possibility that this is a boil or a Folliculitis
( infection of hair follicle ) by bacteria.
Treatment includes :
1)Drainage of pus
3)Saline wash to clean the area
4)Application of antibiotic ointment like Mupirocin ,Fusidic acid
etc two-three times per day.
may be required
6)Anti-inflmmatory medications to relieve pain /swelling etc.
You must visit a dermatologist
to assess the same.Avoid friction and wear loosely fitted clothes till this heals completely.
Hope this is helpful.take care!