Ondansetron is used to prevent nausea and vomiting that is caused by cancer medicines (chemotherapy) or radiation therapy.