What you described may be due to hair folliculitis
. It may be due superficial bacterial infection. As it associated with lymph
node enlargement ,it is better to take a course of antibiotics for a duration of 7- 10 days. You can as well use an antiseptic soap. You will be alright.
You consult your physician and rule out any STD
cause like genital herpes
and take the drugs as per his/her guidance.
You will be alright soon.
Wish you speedy recovery.