The primary treatment for methemoglobinemia is the administration of methylene blue, which acts as a reducing agent to convert methemoglobin back to hemoglobin. In cases where methylene blue is contraindicated (e.g., in patients with G6PD deficiency), alternative treatments such as high-dose vitamin C may be used. Supportive care, including oxygen therapy, is also essential.