Clotrimazole works by inhibiting the synthesis of ergosterol, an essential component of fungal cell membranes. Without ergosterol, the cell membrane becomes permeable and the fungal cells die. This mechanism makes clotrimazole an effective treatment for vulvovaginal candidiasis and other fungal infections.