As the world goes dark, this master switch tells our pineal gland to increase levels of the hormone melatonin in the bloodstream, sort of like a chemical lullaby.
医学百科 The Medicine Book (Big Ideas Simply Explained)
Hormones are made by specialised cells mostly found in the endocrine glands, the hypothalamus, testes and ovaries, and the thyroid, parathyroid, pituitary, adrenal and pineal glands.
As you go to sleep and finally begin to drift off, melatonin is secreted by the pineal gland which begins the sleep cycle, which happens multiple times through the night.