As of November 14 , 2020, the number of people infected with the COVID-19 disease has reached more than 54 million people worldwide and more than 1323196 people have died, according to the World Health Organization . This requires many countries to impose a health emergency or quarantine, which has had positive results in reducing the spread of the COVID-19 pandemic, and it has also had negative economic, social and health effects . So, we suggest a mathematical model for the dynamics of how COVID-19 disease is spread, as well as a mathematical modeling for the dynamics of diabetes, then highlight the negative effect of quarantine has on the health of diabetics . Pontryagin ’ s maximum principle is used to characterize the optimal controls, and the optimality system is solved by an iterative method . Finally, some numerical simulations are performed to verify the theoretical analysis using MATLAB.