When medication doesn't effectively control epilepsy, surgery may be recommended. Doctors can remove the part of the brain that triggers seizures or use certain procedures to control seizure activity.