Diabetes mellitus (DM) and its complications are one of the leading causes of death worldwide, with approximately 700 million people expected to suffer from DM by 2045, according to the International Diabetes Federation. DM is a progressive, chronic disease that affects various body systems and can lead to serious physical health complications. Type 2 diabetes mellitus (T2DM) has been shown to be associated with a higher incidence of sleep disturbances, which may be due to the disease itself or secondary complications or comorbidities associated with DM. However, epidemiological evidence suggests a higher risk of obesity, metabolic syndrome, and T2DM in individuals with shorter sleep duration and poor quality of sleep. Therefore, an assessment of the quality of sleep, its disorders and their pharmacological correction is recommended as a comprehensive medical examination for existing T2DM and for groups at risk of its development. Among pharmacotherapeutic agents for the treatment of sleep disorders, melatonin (N-acetyl-5-methoxytryptamine) attracts special attention. It is indoleamine, a pineal hormone synthesized in the human body, which name is related to the ability to aggregate melanin pigment granules. It has been found that melatonin directly participates in many biological processes and limits oxidative stress both extracellularly and intracellularly. Endogenous melatonin has linear kinetics, the half-life of the usual form of melatonin with rapid release ranges from 45 to 65 minutes, it is quickly metabolized and is completely excreted after 3–4 hours. Currently, 1 and 2 mg prolonged-release forms of melatonin are available, which provide slower and longer absorption, a delayed and lower peak dose, and levels maintained for 8 to 10 hours — similar to the physiological secretion curve of endogenous melatonin. Since the dose of melatonin in prolonged-release forms is much lower than in immediate release forms, this will help reduce the risk of possible side effects, including in patients with T2DM and in groups at risk of its development.