Antifungals work by targeting the cell membrane of the fungus, damaging its structure and inhibiting its growth. This is achieved by interfering with the production of ergosterol, a key component of fungal cell membranes. This disruption ultimately leads to the death of the fungal cell.