The function of insulin is directly related to the regulation of glucose (sugar) levels in the blood.