Thanks for your query.Your five years old child has pain while urinating and had some yellowish material over tip of the penis..I woul dlike to know whether are you able to retract his foreskin? if not then he has a condition called as Phimosis
.There is accumulation of smegma
a normal secretion of glans behind the foreskin.Pl try to retract his foreskin gently and clean the glans and foreskin.If you are not able to retract the foreskin ,you have to consult Surgeon or Urologist
who will perform circumcision
.That is the only permanent remedy.