I don’t know details on how it works but I think it should be a thing under the following circumstances only:

- The criminal has killed or tortured people or animals or otherwise caused serious harm to people’s lives intentionally, without clear display of remorse.
- Bulletproof evidence has been gathered.
- The family/friends of the victim choose the penalty as the designated punishment for the criminal.

Would you, as an individual, kill a person out of revenge if it were legal? Don’t afford the state such a power just because it makes it easier. That kind of oversimplistic emotional reasoning and cold inhuman detachedness is the same kind of mentality that creates the problematic sociopaths etc in the first place. At least make it a conscious choice on the part of someone affected rather than the default of a system.