Methotrexate is a chemotherapy agent and immune system suppressant used to treat cancer, autoimmune diseases, and ectopic pregnancies. It works by inhibiting the metabolism of folic acid, which is crucial for cell division, making it effective in slowing the growth of rapidly dividing cells.