Luckily, chain issues are rare thanks to quality manufacturing and most riders’ adequate maintenance (you have been maintaining your chain, right?).
But should an unlucky break — literally — befall your trip, you should be back on the road in no time if you’re well prepared. An extensive list of tools you might consider carrying can be found here, but for a broken chain, you’ll need:
Chains consist of three parts — pins, plates, and rollers. And if your chain just snapped, you’re likely to find a bent plate where the pressure (from your massive strength!) overwhelmed the system. Assuming only a single “link” was damaged, you won’t have to shorten the chain much and can probably ride the rest of your journey on the mended metal. If the repair demands more than a link or two, you might need to find a bike shop sooner than later, as a too-short chain will affect shifting performance and could be more prone to break again.
Use your chain tool to remove the mangled link by pushing out the remaining pin. If you have a “master link,” you should be able to insert it in the gap and mate the two ends by pressing them together, then using the pedals to apply a bit of pressure with your hand to “pop” the replacement plates into place. Note that master links are speed specific, so if you’ve got a 10-speed drivetrain, make sure you have the right spare link! They’re so light, it’s not a bad idea to carry an extra in common sizes in your repair kit — you might save someone else’s day.
If you don’t have a master link, you’ll either need a spare pin or a deft touch. Unlike a master link (which requires two “narrow” ends to mate), using a pin means you’ll likely need to remove more of the chain to get the right match of plates and rollers. Use the chain tool to drive the pin through the hole. Go slow and keep an eye on your progress as driving the pin past the outer plate won’t help! When you’re happy with the alignment, double check to ensure the link moves freely without binding, then snap off the scored guide piece and get on your way!
If you don’t have a spare pin or master link, the best course of action is to almost completely remove a pin from a good link and then re-drive it through undamaged rollers. This isn’t ideal and can compromise the chain’s longevity because it flattens the flared end, but it should allow you to limp to your next stop.