The scientific term for the yellowish crystalline substance sometimes found encrusted on eyelids when you wake up is “Rheum”, or gound.
It is also commonly referred to as “sand” or “sleep”.
Some amount of dry mucus forming in the corners of the eyes is common even among healthy individuals, especially children.
The substance collects around the eyes because of irritation. During the day, the dried mucus consists of salts and proteins secreted by glands in response to dryness or exposure to pollution.
The mucus continues to collect and dries out in the corners of your eyes while you’re asleep even though tears keep the eyes moist.
The tears have three separate components.
The innermost tear layer coats the surface of the cornea and is called the mucous layer or mucin. The middle tear layer is an aqueous layer produced by the lachrymal glands and supplies salt, proteins, and other compounds to the cornea. The outer tear layer is composed of oil from the meibomian sebaceous glands in the eyelids.
This helps to prevent evaporation of the watery tears from the surface of the eyes.
Thick, frequent yellow or green mucus in the eyes is often a sign of viral or bacterial conjunctivitis.
There seems to be no widely used specific term, perhaps because the effect is seen as trivial and erratic. Nonetheless, it is important. During the day grit, dead cells and other debris accumulate in the tears which are more than mere salt water.
Mucoproteins cover the eyeball, curdling protectively around sharp grit to encase it in mucus.
A middle salty layer is the main liquid part, and an outer, oily layer reduces evaporation. At night, movements of the eye and closed eyelids stir this orbital midden, massaging solids toward the inner corner of the eyelids.
There the exposed liquid evaporates until the residual sludge forms pellets that you remove harmlessly by washing, or with your finger, the next morning.
Gritty environments such as deserts may damage eye tissues enough to convert your tears into dilute pus.
This dries on the edges of your eyelids, gluing them shut in spite of the waxy coating that normally reduces spillage and keeps their epidermis water-repellent. It can be very disconcerting to awaken from an exhausted sleep to find your eyelids sealed shut so that you think it is still dark.
If this ever happens to you, soak them open gently, or you may lose some eyelashes in the sand.
The substance that collects in the corner of your eyes is also called “mucopurulent discharge”.