First attested in 1857, this word was originally a technical term used in golf. Its original meaning is "to block an opponent's path to the hole with one's own ball", from the noun stymie, which meant "a situation in which an opponent's ball blocks one's path to the hole".
The noun is attested from 1834, and is of uncertain origin. The most likely source is Scottish stymie, "a person with poor vision", which itself is from Scottish stime, meaning "the least bit", through the idiom "unable to see a stime". Stime is attested from the 14th century, and itself is of unknown origin.
The verb form of this word attains its general meaning of "to block, thwart, or hinder" by 1902.