Methotrexate is an antimetabolite that inhibits the enzyme dihydrofolate reductase, which is necessary for DNA synthesis and cell replication. This action slows the growth of cancer cells and reduces inflammation in conditions like rheumatoid arthritis and psoriasis.