If you have ever been a Boy Scout, or a parent of Boy Scout you have heard this phrase over and over and over. But, it is actually very good advice for any outdoor activity including riding. Recently I went up in the mountains with a couple of guys on our dirt-bikes for a nice fall ride. The day was beautiful and warm and we had the trails to ourselves. But, well into the trip one of the guys was unlucky enough to have a sharp stick or root go through his rear tire and tube. We got it patched and thought we had it made until one of the patches failed as we were putting the wheel back on the bike. The holes in the tube were just too big. He was able to ride it out until we hit a USFS road and had to wait there while I went back to the truck and drove around the other side of the mountain to pick him up. Fortunately the rain waited until I got to there so he didn't have to get wet.
So the burning question each rider has to address is how much "stuff" do you carry? I have personally struggled with this over the years and have gone from carrying enough junk to live in the woods for a month to just the bare essentials. Here are some things to keep in mind.
Always be sure to have a map of the area you plan to ride. Even if "you know it like the back of your hand". There is a very good chance that someone in your group does not know the area well, or if where you ride is like my area, there are lots of "user" trails that are not mapped but come out somewhere and you need a map to orientate yourself.
I always make sure to have plenty of water, an emergency space blanket, extra gloves and something to put on my head other than my helmet. In the summer I just carry a small spandex skull cap and in the winter I carry a knit cap. If you are the one waiting for rescue you want to be sure you don't end up with hypothermia before help arrives. Carrying matches is also a bonus, though depending on where you are riding a fire may not be possible, or a good idea. During the Fall/Winter I also carry a light wind breaker. At the very least the combination of the space blanket, the wind breaker, dry gloves and cap will keep you relatively warm.
As far as tools, I carry just enough wrenches and sockets to pull the shrouds and change the spark plug. For most Japanese bikes, most everything can be done with an 8, 10, 12 and 14 millimeter wrench and/or socket. An extra spark plug (and yes they do foul occasionally of 4 strokes) and spark plug socket that I know will actually get to the plug on my bike. Believe it or not, not all sockets are made alike and you would be surprised at how difficult it can be to get a spark plug out. A set of Motion Pro lightweight aluminum tire spoons that have a wrench on the end to remove the front and rear axle nuts, a tire patch kit, small hand pump and lots of zip ties. I personally don't carry the CO2 setup just because once the little cylinders are empty your are finished.
You will never be able to plan for every problem you might encounter. But you can be ready for many of them. The best way to avoid problems on the trails is proper maintenance of your bike. Always check your tire pressure before you go, look for problems with your chain, loose fasteners, etc. Keep up on your oil changes and cleaning your air filter. Ignoring little things can very easily turn into big things when you are 20 miles from the truck with no cellular reception.