The way it is practiced in the US is both inefficient, incompetent, often unjust (racism, poor legal representation, biased judges/juries, evidence tampering, unreliable witnesses, dna evidence, etc), often controversial, needlessly cruel, and obviously not working in terms of its supposed preventive function. It's a mess.
That's the reason why an increasing number of states are opting not to. It's just too controversial of a topic and the political price of getting it wrong is too high. It's a PR nightmare and it's one of those things that is only getting harder because of all the recent problems failing to get it right. At this point all executions are highly political and typically only pursued in states where this is relatively uncontroversial. All opponents have to do is point all of the above out. Which of course they do.
The hypocrisy around trying to humanize what is basically state sanctioned murder has resulted in weird practices around multiple executioners pushing a button to avoid knowing for sure whether or not you killed the person, weird rituals around selecting the means to kill where the result is neither humane, particularly efficient, or cheap. The whole thing is a weird guilt trip gone wrong. Ironically this has made it more controversial, not less.
From what I understand, killing people swiftly and painlessly is not technically hard. Any vet or butcher knows how to put down an animal humanely. This is done routinely every day. E.g. a bit of N2, N2O, CO, or similar is all you need for what is pretty guaranteed fatal and painless. Hypoxia followed by unconsciousness in seconds and death in minutes, typically. The main objection against this particular method seems to be that it is too humane (make up your mind already). The key point of that is that the death penalty is primarily about revenge and not about prevention. Stating this further de legitimizes the death penalty and is in itself controversial. State sanctioned torture is even more controversial than the state sanctioned executions.
At least the Brits were efficient and competent about hanging people. It's the systemic incompetence around the death penalty that is killing it in the US. Either way, I'd suggest fixing that level of incompetence and getting that off the table at least. I'd say the Brits were wise to get away from that.