Firstly you need to check out the color of the discharge, since it in some ways can indicate how serious the problem might be.
If it is clear discharge, then it means maybe there is something such as an eyelash or dust is in the child's eye or maybe the tear duct is blocked. Sometimes it may resolve on its own, but if the symptom continues , it may need medical treatment from the doctor.
If it is white and stringy discharge, it means the child is suffering from allergy eyes and needs to see the doctor.
If it is green discharge, maybe it is because of viral infection.If a child wakes up with a green discharge that holds the eyelids shut, the parents should be extremely cautious of this condition. Waking up with only a mild amount of dried green discharge in the corner of a child's eyes may be normal.
If it is yellow-green discharge, then it is most likely a type of bacterial conjunctivitis. This condition can be dangerous to the eyes, and it does not resolve on its own. It is also a contagious condition.
If the discharge is not continuous, and the child does not appear to be in any discomfort,the parents may wait 24 hours and see if the discharge resolves. And if the condition becomes serious, the parents need take the child to see their pediatrician, ophthalmologist or optometrist.