Metformin is a generic prescription drug that works to treat type 2 diabetes by helping lower your blood sugar levels. Your response to this drug may vary based on your medical history and diagnosis.