An antifungal drug is medication used to treat fungal infections such as athlete's foot, ringworm and candidiasis (thrush), as well as serious systemic infections like cryptococcalmeningitis.
Unlike bacteria, yeasts and fungi are eukaryotes, as are humans (and all other plants and animals). The basic structure of a fungal cell is nearly identical to a human's. This means finding a target for an antifungal to attack, that does not exist in the infected organism, is more difficult.
The polyenes interact with ergosterol in the fungal cell wall, causing the cell's contents to leak out and the cell to die. Human (and other animal) cells contain cholesterol instead so are not destroyed.