The foreskin on the end of the penis will trap old sloughed skin and will remain moist if the foreskin is not retracted and cleaned periodically. The white material that collects under the foreskin is called smegma. Fungal infection due to chronic moisture there is a problem for some men. Either or both can have an odor. An infection of the foreskin from bacteria or from fungus is called “balanitis”.
All boys and men after a certain age should be encouraged to retract the foreskin when in the shower or bathtub and to wash this area well. The foreskin should also be pulled back for drying with a towel after washing. Pulling the foreskin back while urinating is also advised so this area stays clean and dry as much as possible all day. But make sure to pull the foreskin over the end when done!
If the foreskin cannot be retracted, that is called “phimosis”. If you pull the foreskin back and leave it that way too long (think hours), then it can swell and not want to go back over the end of the penis. This is called “paraphimosis”. You should think to see a urologist if you have balanitis, phimosis or paraphimosis.