The function of insulin is to regulate sugar levels in the bloodstream. Thus, it plays an important metabolic role, doing the opposite of glucagon. Whereas glucagon keeps up the amount of glucose (sugar) to avoid hypoglycemia, insulin lowers glucose levels when they have gone up above normal limits, which range between 70 and 110 mg/dL.
How does it do it. This hormone induces the hepatocytes (liver cells) to metabolize and convert the excess glucose into glycogen. A large molecule of glycogen is made up of several smaller glucose molecules that have been folded up, compressed, and stored as a first fuel reserve. However, if you keep eating carbohydrates (flour, sugar, fructose), insulin will keep activating hepatocytes, but this time the liver cell mitochondria will convert the excess glucose into molecules of triglyceride (fat), which will be stored in the adipose cells as a second fuel reserve of the body, and this is how someone becomes obese.
As you know, insulin is produced by the beta cells of the islets of Langerhans of pancreas. Then it is released into the pancreas blood capillaries, which empty into the pancreatic veins and, these, into the splenic and portal vein, carrying the insulin-containing blood into the liver.