Fungal infections are treated with antifungal medications that target the cell membrane or cell wall of the fungus. Common antifungal drugs include azole compounds, echinocandins, and polyenes. Treatment duration can vary depending on the severity and type of infection.