It seems that you might be having fungal infection
super added with bacterial infection due to itching or due to friction of tight pants.
Apply antibiotic cream locally.
Go for antibiotic medicines after consulting your doctor.
Go for treatment of fungal infection as well.
Keep local part clean, dry and airy.
Ok and take care.