Getting enough folic acid, a type of vitamin B, before and during pregnancy prevents most neural tube defects. Treatments vary depending on the type of defect.