No matter how carefully you go over your bike prior to a ride, it is just a matter of time before a mechanical failure will occur.
Fixing a flat on the side of the trail is one of the foremost important repair skills. Wish for flats during your training rides so that you will be ready should your tire leak air on race day. Have you run out of brand new tubes for the repair? No problem: make a knot at the spot of the leak. I am not going to lie to you; it might get a little tricky to fit the tube back between the rim and the tire. However, when done right, it is virtually impossible to tell the difference between that repair and a wheel with a new tube.
Personally, the second most likely failure I’ve experienced concerns the chain. Contrary to a flat tire, most chain problems can be avoided with some proper maintenance done at home or at the bike shop. Monitoring the wear of the chain and changing it preventively will considerably reduce the chance of the chain breaking or the chance of the chain getting caught in the spokes of the rear wheel. Personally I usually do not carry a quick link on my rides. Not because I don’t like them, it is simply because I forget them at home…. So, yes it while a quick link will definitely speed up the chain repair, it is not essential; the multi tool with the chain breaker is!
A basic understanding on gear adjustment will go a long way. Countless times, I’ve adjusted cable tension on the fly to keep the shifting of the gears as smooth as possible. Knowing what the “limit” screws on the derailleurs do, will also enable you help yourself on the side of the trail.