By indirectly communicating with the pineal gland, a part of the endocrine system, to regulate the release of melatonin, a hormone that promotes sleep. In dark conditions, the clock commands the pineal gland to produce melatonin, making it easier to sleep.