system
Given the following post, respond as if you're commenting on Reddit:
human
Why do we get the green/yellow goo in the corner of our eyes when we sleep and why don't we get it in the day when we're awake?
gpt
Basically, you're eyes have to be moist constantly.  This means that there is a constant stream of liquid flowing from the outside corner across the eye, which drains into the opposite corner through the duct near the nose.  When you blink, it's to spread the liquid across the eye, which prevents it from drying.  

The eye produces the liquid in such abundance that if the duct were to inflame and become closed, your eye tears up quickly.  When you are hurt or emotionally distraught, the duct is closed by pressure building around it from your sinuses.  This is what makes your tears flow.  When your tears dry on your face, you can feel the itchy sort of calcium/salt from it's trail.

This same build up occurs when your sleep.  Your eyes are close, thus the liquid flows across the eyes quickly and in large quantities.  Unfortunately, the draining duct cannot take it all.  So slowly a small bit overflows the duct.  As it does, it dries when it contacts with the air.  Which each bit drying over the last layer, it creates the "green/yellow" hard "goo" in the corner of your eye.

You will notice this more frequently if your sleeping in a room with low humidity, as it will dry and crystallize much sooner, creating an almost sand like grain that you can rub away.