Diabetes, also known as diabetes mellitus, is a chronic degenerative disease with a variety of adverse complications. Due to its slow progression, a mathematical model of the diabetic population with time lag is developed. This novel study aims to analyze the stability of the diabetic equilibrium and also formulate an optimal control problem with lags. We show that under some values of parameters, a limit cycle arises through Hopf bifurcation. Sensitivity analysis, which used the direct differential method, reveals which parameters have a major impact on the model dynamics. An optimal control strategy is developed with two control variables for the description of the control strategy. A suitable objective function is formulated to minimize the total number of diabetics and the relative cost of implementing the controls. The resulting optimality system is solved numerically by using the Forward-Backward Sweep Method. Graphical results are examined with different parameter values and are compared with and without controls. The total number of diabetics continued to increase without controls, but the number of these individuals decreased after control. The optimal controls prevent the progression of diabetes complications by awareness, education, and medical care at the least cost.