Smegma is fairly easy to prevent. At a young age, children should be taught to wash themselves thoroughly, and taught exactly how to wash themselves in such a way as to ensure cleanliness is achieved. Young boys, regardless of circumcision, should be taught to clean themselves fully, as this condition can occur with circumcised penises as well as uncircumcised penises. Explain to them that they need to make sure that the foreskin is fully retracted when it is cleaned, to make sure that they are using clean hands and water, to never use soap, and to always dry themselves with a clean towel and put clean underwear on afterwards.
Using a special washgel can be very helpful in keeping the penis clean, it will enable you to wash more thorougly. Always use a neutral washing gel that protects the sensitive skin of the penis. If no tap water is around, you can use special intimate wipes to clean up.