Hanging
Hanging was a form of capital punishment by which an individual was suspended in the air by a rope, usually tied at one end into a  called a "noose". 

Hanging was the killing method in the cultural practice of lynching. ()

On an alien planet inhabited by Gosis' species, hanging was the preferred method for carrying out the death penalty. ()

In addition to capital punishment, hanging could also be self-inflicted as a means of committing suicide. (, )

Notable hangings 
In 2153, on the Skagaran colony, a Human posse led by Deputy Bennings hanged a Skagaran for allegedly killing a man named Clay Stanton. ()  

In 2267, Trelane held a mock trial of Captain James T. Kirk on Gothos where he issued the verdict that Kirk would "hang by the neck until" he was "dead, dead, dead." ()

In 2268, as part of a conviction for fraud, the judiciary system on Deneb V offered a guilty party the choice of death sentences, one was death by hanging. ()

In the 2310s decade, Yvette Picard committed suicide by hanging as a result of severe untreated mental illness. ()

In 2365, Kira Nerys feared she would be hanged as a rebel for sabotaging Terok Nor's ore processing center. ()

In 2369, Constable Odo faced charges of murder and he was hunted down by an angry mob who cornered him in his security office. Commander Benjamin Sisko tried to calm the situation and asked what the angry people wanted to do with Odo. Zayra answered, "He's right. How do you get a rope around the neck of a shapeshifter?" ()

Later that year, the Bajoran Kainon told Odo to be inform him when the Cardassian prisoner, Aamin Marritza was hanged. ()

In 2372, Quark rejected hanging as a means to end his life when attempting to fulfill a contract with Brunt calling for his death. Quark thought that hanging took too long. ()

In 2374, during the Dominion occupation of Deep Space 9, Vedek Yassim organized a demonstration on the Promenade. Yassim appeared on the upper promenade level and exclaimed "Evil must be opposed" before she stepped off the second level with a rope around her neck, hanging herself. ()

In 2375, after the crew of  voluntarily chose to disobey Captain Kathryn Janeway's orders, Janeway remarked that they could all be "hanged for mutiny," a reference to the ancient naval custom of hanging mutineers. ()

Appendices

Apocrypha 
In the DS9 book series Star Trek: Deep Space Nine - Millennium, Quark is hanged on the Promenade for the crime of being a Ferengi, amongst others, by a group of angry Cardassian soldiers on the Day of Withdrawal from Terok Nor. He was subsequently rescued by another group of Cardassians.

External links 
 
 

de:Erhängen
Punishments
Death