Clotrimazole works by disrupting the cell membrane of fungi. It inhibits the enzyme lanosterol 14-alpha-demethylase, which is crucial for the synthesis of ergosterol, an essential component of the fungal cell membrane. This disruption leads to cell lysis and death.