Nystatin is an antifungal medication primarily used to treat fungal infections, particularly those caused by Candida species. It works by binding to sterols in the fungal cell membrane, creating pores that lead to cell death. This drug is available in various forms, including oral, topical, and suspension formulations.