Because the full effect on the brain is still unknown, electroconvulsive therapy is viewed as a last resort treatment for the mentally ill. Still, there are around 100,000 people seeking the treatment each year, including Carrie Fisher.
Electroshock therapy has been featured in many movies, usually as a total nightmare meted out by sadistic doctors on an innocent patient for no reason and with no benefit. And it's still used today. But why? Because, despite its depiction on film, it's painless and effective.