Antifungal medications work by targeting the fungal cell membrane or cell wall, causing the fungal cells to become permeable and eventually die. For instance, azoles like fluconazole and clotrimazole inhibit the synthesis of ergosterol, a critical component of the fungal cell membrane. This disruption weakens the cell membrane, leading to cell death.