welcome to health care magic
It may be an infected hair follicle or folliculitis
which can result in a painful lesion with a discharge.
Treatment may involve the use of hot moist compresses to encourage drainage
and the use of topical antibiotics. In severe cases oral antibiotics
may be required.
They can be avoided by : avoiding shaving the area, reducing friction from clothing,keeping the area clean, avoiding contaminated clothing and washclothes
I hope this helps