Antifungal medications work by either killing the fungus directly or by preventing it from growing. How they work depends on the type of medication. Azoles stop the fungus from growing, echinocandins damage the fungus walls, and polyenes kill and destroy the fungus cells.