Surgery is a procedure that eliminates or alters a specific area of your brain that causes seizures. Epilepsy surgery is effective when seizures always originate in a single place in the brain. However, it is not the first line of treatment, but is often considered when at least two anti-seizure medications have failed to control seizures.