No, not the dance. I'm talking about the literary device. The thing that makes you go "whoa" like Keanu Reeves.
It's not that difficult of a thing to pull off, but you have to know how it works, and you have to plan ahead. You can't pants your way to a good twist. Not without revision, anyway.
So what makes for a good twist? Two things:
1.) The twist must come as a surprise to the reader. Duh.
2.) The twist must appear inevitable in hindsight. You want the reader to slap his forehead and say "I should have seen that coming!" (This is the hard part.)
Fortunately, it's not as hard as you might think. You just have to have your ducks in a row. Here's what you do:
1.) You hint at the twist early in the story. You want the reader to suspect the truth. Or, if he already suspected, you want to affirm his suspicions. You want the reader to feel like he's outsmarted the author.
2.) You then discount the truth. You want the reader to believe the twist ain't the real deal after all. This opens his mind up for the misdirection.
3.) You spend the bulk of the story chasing red herrings. You scramble the reader's brain to the point that he has no idea what the truth actually is. All he knows is that it's not the twist, because that's already been ruled out. Finally, at the end, you come back to the original concept that you hinted at in step 1.
Let's do an example.
Mr. Smith lies dead on his living room carpet. Mr. Noir, the local detective, shows up to investigate. He quickly learns that the only one who could have entered the house at such a late hour was the butler. Mr. Noir interrogates the man. But, alas, he has a rock-solid alibi. The butler couldn't have done it. Mr. Noir must delve deeper into the murder and look at other suspects. He spends the rest of the story chasing down lead after lead. Finally, he obtains a crucial clue. He then gathers all the suspects in Smith's living room and says he will solve the crime. He reveals the hitherto-unknown fact that the butler was chummy with one of Smith's old enemies. The butler lent him his housekey and then attended some event or other in order to establish his alibi. While the butler was out, the old enemy entered the house and whacked Mr. Smith. Later, the butler eliminated the assassin in order to cover his tracks. The butler did it! Well, the other guy performed the actual killing of Mr. Smith, but the butler was a co-conspirator, so he still did it, legally speaking.
This sort of thing is standard fare in mysteries. If you know the formula, you can predict where some stories are going to go. A clever writer will provide two or more possible twists so that highly perceptive readers don't know which telegraphed ending is the actual one. He'll try to discount all the outcomes that he think the reader might suspect. But that's a lot more work, and usually not necessary. For most readers, the simple twist formula will suffice.