A common theory is that the idiom refers to hanging, either as a method of execution or suicide. However, the actual origin of the idiom is a matter of dispute.
The prevailing notion associates the term with hanging, either for execution or suicide. Nonetheless, the authentic origin of the phrase is a subject of contention.