Antifungals work through various mechanisms to inhibit the growth of fungal cells. For instance, azoles like fluconazole and itraconazole inhibit the synthesis of ergosterol, an essential component of fungal cell membranes. Polyenes like amphotericin B bind to ergosterol, creating pores in the cell membrane and causing cell death.