Hello,
It can be due to fungal infection or jock itch. Treatment involves topical and oral antifungal medicines. Most cases of fungal infections respond to over-the-counter products, which contain any of several basic ingredients: miconazole, tolnaftate, terbinafine, ketaconazole and clotrimazole. You can consult a pharmacist and get any cream or lotion containing these ingredients. Some of them are Lamisil, Monistat derm, Mycelex, and Nizoral.
If the symptoms persist then please consult a dermatologist.
I hope it helps. Take care and please do keep me posted in case you have any additional doubts. Kind regards.