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 knot called a "noose".

To effect a hanging, the rope was affixed to a tree, beam or other fixed point, and the noose was tightened around the victim's neck. The victim was then pulled up or a support was dropped from underneath him until his entire body weight was being borne by his neck. Death would subsequently result from strangulation or the neck's inability to bear the weight of the victim.

On the unnamed planet inhabited by Gosis' species, hanging was the preferred method for carrying out the death penalty. 

Notable hangings
In 2153, on the Skagaran colony, a Human posse led by Deputy Bennings hung a Skagaran for alledgedly killing a man named Clay Stanton. 

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 2267, on stardate 2124.5, 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 2369, Constable Odo faced chages 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?"

In 2369, the Bajoran Kainon told Odo that he wanted to be informed when they hanged the Cardassian prisoner, Aamin Marritza. 

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, on stardate 51096.2, 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, on stardate 52081.2, after the crew of USS Voyager 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. 

Apocrypha
In the DS9 book series Star Trek: Deep Space Nine - Millennium, Quark is hung 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.