Smegma is a natural "waste" material produced inside the foreskin. It is composed of secretions mixed with shed cells of the mucosa. Normally, it would look something like a soft cheese. It could form as a film over the entire glans, or it could be in little curds nestled in the sulcus (groove). The color could range from white to yellow, and it often has a distinct odor. If left long enough, the odor resembles some cheeses.
http://www.foreskin.org/smegma.htm
Daily rinsing with clear water keeps it under control, but in reality, nothing need be done about it, as normal sexual activity clears it away.