Azoles are antifungal agents that target fungal cell membranes by inhibiting ergosterol synthesis. They bind to the 14-alpha-dimethylase enzyme, preventing the conversion of lanosterol to ergosterol. This leads to an accumulation of harmful sterols and a depletion of ergosterol, ultimately destabilizing the cell membrane and causing fungal cell death.