Fungal infections occur when fungi invade areas of the body and overwhelm the immune system. There are several classes of antifungal drugs that target harmful fungi, including imidazoles, triazoles, allylamines, and polyene antibiotics. Imidazoles like miconazole and econazole damage the fungal cell membrane. Triazoles like fluconazole inhibit ergosterol synthesis. Allylamines such as terbinafine inhibit fungal cell membrane synthesis. Polyene antibiotics like amphotericin B and nystatin bind to ergosterol in the fungal cell membrane.