Electroconvulsive therapy (ECT), as a treatment is effective for some psychiatry conditions, and can be given as per clinical condition on the advise of the treating psychiatrist. You should discuss with the psychiatrist about your doubts and the rationale about choosing this treatment.
Long-term serious harmful effects have not been substantiated, and in some conditions it is very effective.