Change their diaper often, and use cotton wool balls and cool boiled water to clean off any poop that gets on their penis. Let it air-dry and apply petroleum jelly on the tip of the penis before wrapping the diaper to prevent irritation.
If the discharge and redness do not reduce and with foul-smell, the baby does not pee for 8 hours or has a fever, consult the doctor immediately.