Antifungal medications are typically prescribed when a patient presents with symptoms of a fungal infection, such as itching, burning, and abnormal discharge. A definitive diagnosis is usually made through clinical examination and laboratory tests, such as a vaginal swab. Once an infection is confirmed, the appropriate antifungal medication is prescribed based on the type and severity of the infection.