The prevalence of diabetes has been rising in many regions of the world year by year. Cognitive impairment and dementia in patients with diabetes creates a great burden for patients, their families, and society. In the management of diabetes, self-care behavior is very important, but this behavior is impaired by cognitive dysfunction. This review briefly describes the concept of cognitive function, effect of both type 1 and type 2 diabetes on the cognitive function and the various mechanisms linking diabetes and cognitive impairment. Hyperglycemia alters the body mechanisms through a variety of pathways including increased formation of advanced glycation end products (AGEs), polyol pathway activation, diacylglycerol activation of protein kinase C and increased glucose shunting in the hexosamine pathway. These same mechanisms may be responsible for inducing the changes in brain leading to cognitive dysfunction that have been detected in patients with diabetes. Even though the pathogenesis of cognitive dysfunction is only partially understood, studies suggest that the changes in cerebral structure and function in diabetes are related to hyperglycemia-induced end organ damage, insulin resistance and amyloid lesions, vascular diseases and hypoglycemia. The future development and implementation of diabetic treatments, especially for the elderly, should also consider in preserving their cognitive abilities