Problems tend to arise when your esophagus contracts around the latter, so the entire trick to sword swallowing is to slowly (usually over a few years) train yourself to control your gag reflex. If stopping an automatic reflex sounds impossible, just ask any contact lens wearer. The first time you try to touch your eyeball with your finger, your eyelids reflexively slam shut. But after a few months of inserting contacts every morning, you get to where you can jab you finger right in there without so much as a twitch. It's just a matter of concentration plus repetition.
So once you've gotten control of your gag reflex, it's just a matter of tilting your head back at a 90-degree angle (so that your GI tract is straightened out), and then you've got a more or less straight path for the blade (or whatever) to slip down your throat. You do have to do it slowly -- your GI tract still isn't perfectly straight so you're kind of using the sword to gently nudge your internal organs out of the way.
AGAIN: DO NOT ACTUALLY DO THIS.