metformin
Metformin is the usual first pill prescribed for type 2 diabetes, and its main trick is to tell the liver to stop overproducing sugar. In type 2 diabetes the liver keeps dumping glucose into the blood even when it is not needed; metformin turns that tap down. It does this without forcing the pancreas to release insulin, so on its own it almost never causes dangerously low blood sugar.
Mechanistically, metformin is a biguanide that suppresses hepatic gluconeogenesis, the liver's manufacture of new glucose, partly by acting on mitochondrial energy metabolism and activating the cellular energy sensor AMP-activated protein kinase. It also modestly improves insulin sensitivity in muscle and reduces glucose absorption from the gut. Importantly it is not metabolized; it is cleared unchanged by the kidneys, which is why kidney function governs its dosing.
Beyond lowering glucose, metformin tends to be weight-neutral or mildly weight-reducing and is inexpensive, which keeps it first-line worldwide. Its common nuisance is gastrointestinal upset, including nausea and diarrhoea, often eased by slow dose escalation or extended-release forms. Its rare but serious risk is lactic acidosis, a buildup of acid in the blood, which is why it is avoided or paused in severe kidney impairment, acute illness, or before procedures using iodinated contrast.
Because metformin is eliminated unchanged by the kidneys, dose is reduced or the drug stopped as renal function falls; it is typically held around procedures using iodinated contrast to lower the risk of lactic acidosis.