Most often eye discharge is not dangerous.
The eye crust that forms when you sleep “During the day, we’re frequently blinking and washing away dirt, dust, exfoliated skin cells and mucus, when you’re sleeping, you’re not blinking, so all of that mucus, oil, dirt and skin cells accumulate in the corners of your eyes.” Because you are not blinking at night, this mucus can build up. Eye discharge may collect in the corner of your eyes and along your eyelash line.
It can be hard and crusty, or it can also be sticky and wet. Most of the time, this substance is a whitish or cream color, although, If your eye crust is yellow or greenish, or if you feel pain or discomfort, it could be a sign of an eye infection. Seek professional care.
When you are awake, a tear film called Rheum keeps your eyes moist and protected. Rheum is a combination of mucus produced by the conjunctiva produced by meibomian glands. Every time you blink, your eyes flush it away.
Your eyes produce mucus to protect themselves. However, eye crust can be uncomfortable and feel scratchy.
When bathing, use a washcloth that’s been soaked with warm water, it is a safe, easy way to clean your eyes in the morning, and it provides the added benefit of keeping you from touching your eyes, which is one way to transmit bacteria to your eyes.”
In most cases this will bring your lid back to health in a matter of a few days. Make this a habit, as it is a healthy one. This is usually recommended by ophthalmologist and optometrists with regard to dry eyes and crusty eyes.