The study of the structure, function, and diseases of the endocrine system, which regulates hormones.