Diabetes is the most common endocrinopathy, in 2014, 8.6% of the population suffered from diabetes, and it was responsible for at least 3.7 million deaths per year.It is estimated that by that by 2050 more than 30% of the population will have this disease.In cardiovascular surgery, it is described that 5.2% of patients are undiagnosed diabetics and this rises to 10% -28% in non-cardiac surgeries.The adverse results are markedly high in those patients with poor glycemic control including an increase of more than 50% in mortality, as well as an increase in respiratory infections, surgical site infection, urinary infection, heart attack and acute kidney injury among others.During the preoperative period of patients with diabetes, it is important to review glycemic control and its current treatment, in addition to providing the patient instructions on how to adjust medications.Intraoperatively, any condition that leads to an uncontrolled increase in surgical stress must be controlled, since this in turn generates hyperglycemia.Knowledge of insulins, their pharmacology and schedules is essential to maintain blood glucose intraoperatively in normal ranges.Different practical algorithms are proposed for the correct and safe management of hyperglycemia in the perioperative period.All care should be continued in the postoperative period defining the continuity of the insulin therapies established and the postoperative care of the patient.