Controlling blood sugar levels is important for immune function for several reasons: High blood sugar levels can impair immune function. Diabetes can increase the risk of infections. Certain nutrients can support immune function and blood sugar control, such as vitamin C, vitamin D, zinc, and magnesium are important for immune function and can also have blood sugar-lowering effects. By incorporating these nutrients into their diet or through supplementation, people with diabetes can support their immune function and blood sugar control.