I just recently went through this with my 2 year old.
I thought perhaps he has some sand trapped under his foreskin, as we had been playing bare bum at the beach.
He had also spent extended time in a wet diaper while on long bus ride.
This is what helped.
- spending as much time as possible diaperless.
- warm bath with salt, and drops of lavender and tea tree pure essential oils.
- a zinc and calendula cream on his penis overnight.
It took a day or two to go down and is now back to normal.
Hope this helps. If it went on much longer I might have gone to a doctor.