That information can be found in the Code of Practice to the Mental Health Act. The code isn't law, but it describes the various acts, statutes, and case law and so a health care practitioner would have to ahve good reason to deviate from it.
https://assets.publishing.service.gov.uk/government/uploads/...
If you want to make it even harder for them to give you ECT against your wishes you can make an advance directive. Go see a lawyer that deals with mental capacity stuff and get one drawn up. Be clear and specific.
But, please do take note of what this woman has said:
> Despite the discomfort and the temporary memory loss it caused, I would have ECT again without hesitation. People voluntarily undergo much more invasive and damaging medical interventions to save or to prolong their lives—chemotherapy, radiation, open-heart surgery, blood transfusions, bone marrow transplants—and speak freely about those experiences, but continue to think about cancer and heart disease differently from mood disorders that can be equally deadly. In telling my own less than ideal story 30 years after the fact, I don’t want to discourage anyone from having this potentially life-saving treatment. What was difficult in my experience would now be unusual because the treatment protocol has improved over the years to greatly reduce the side effects. And my situation was extreme not only because of the perilous condition of my mind, but because my body was already hypersensitive and aggravated by drug allergies.
I know a few people who've had ECT and a couple of them hated it and are still angry it was done to them, but most of them are glad they had it done and would do it again.
It's hard to work out how much harm it causes because it's only used in people with the most severe depression, and that causes similar harms itself.