OK, this is a long read, but it does a good job of outlining the different types of fungal infections, and how to treat them: https://www.webmd.com/skin-problems-and-treatments/guide/fungal-infections-skin#
There are loads of over-the-counter products designed to treat these infections mostly topical creams or sprays. Unfortunately, sometimes you just have to go with trial and error. I had a skin fungus that didn't respond well to Lotrimin, but tried a product with a different active ingredient (Tinactin, I believe) and that worked.
Make sure to keep the area cool, and most of all, DRY. Don't rub it dry, but use an absorbent cloth to pat it dry several times a day, and of course dry thoroughly after a shower and before applying the cream (or spray).