Prevention is better than cure
The main thing I’ve learnt in all my cycle touring is that things are less likely to go wrong if they're set up properly in the first place.
Spend time with your bike before you set off, learning how everything fits and which part does what. Take it to a shop for a once-over. A basic maintenance course is also a good idea.
A general rule of thumb is: anything rattling or rubbing will get worse as you ride - a quiet bike is a happy bike.
The dreaded puncture
Punctures don’t happen that often but there are a lot of simple things you can do to reduce the risk. Invest in quality tyres with puncture protection, pump your tyres to the correct pressure, and check the tyre frequently for shards and stones and lever these out (I carry a tiny screwdriver for this).
Punctures are more common in the rain and you don’t want to be taking your tyre off for the first time in a torrential storm, so have a practice at home first.
If repairing a puncture check the inside of the tyre for stubborn shards of glass/thorns/pieces of flint otherwise you may make a new hole straight away.
Most cyclists swap their punctured inner tube for a fresh one straight away - it’s quicker and you can patch the old one at your leisure which you can then use as a spare. But don’t be afraid to patch - with touring, you have all the time in the world. Wait for the glue to turn tacky before putting the patch on - it will take far longer to stick if you rush. A patched inner tube, when done right, is just as good as a new one. I find glueless patches less effective. Again, when touring, you’re not so in need of efficiency.
If it’s a blowout you’ll need to use your spare tube. Use a folded section of the old one to line the inside of the tyre if you’ve blown a hole in it.
Look after your chain and gears
Be nice to your chain by avoiding changing gear when standing up in the pedals, and keep it as straight as possible (e.g. if you’re in a high gear at the front you should be in a high gear at the back). Carry a Quick Link in case the chain snaps — remove broken link using a chain-breaker and snap the Quick Link in place.
If the derailleur itself breaks, you can remove it completely and shorten the chain so it sits on one of the middle rings — you’ll only have one gear but at least you’ll be able to ride.
Racks and frame
Bolts in racks can rattle undone as you ride so check them regularly. Cable ties can be fed through the bolt hole, but they break easily so string or twine is much better.
If the rack itself breaks, see what’s in your luggage or by the roadside that can be used as a splint. A spoon handle lashed in the right place can be very effective.
Check your wheels
You should check regularly for loose spokes and learn how to tighten them with a spoke key. Carry spare spokes, they can be taped to your top tube. Broken spokes in the front wheel can be replaced without even taking the wheel off. Copy the lacing pattern (typically over-over-under) of the other spokes. Don’t be afraid to give it a fair bit of force.
The rear is more difficult because you have to remove the gears which require using a specialist tool. A broken spoke will cause a buckle in the wheel and put more pressure on the remaining spokes, so replace ASAP. Loosen off the surrounding spokes and the brakes if necessary to allow the wheel to turn.
Brakes will wear
Brake pads will wear as you ride, especially in wet conditions. Turn the barrel adjuster periodically to ensure the brake is still engaging (unscrew the barrel adjuster to tighten the cable). Also, remember to keep an eye on the pads to ensure they don’t go beyond the wear line.
Broken cables are easy to replace with a little intuition (and of course a spare cable). The typical path of brake cable: Hook inside lever, through barrel adjuster, outer casing (maybe two separate pieces of casing or one single), noodle (curved metal part - only on V brakes), bolt.