"To build a fire".All generally good advice here.
I'd just add that an ounce of prevention can save a lot of field repairs. So get in the habit of preflighting your bike before each ride. Be fussy about maintenance and fix everything that is broken -- stuff isn't going to fix itself on a ride.
Be proactive about replacing tires. Depending on the surfaces you are riding on you might want to replace tires every 1500 miles if you ride on a lot of janky stuff.
Get a good book on bike repair, watch youtube videos on bike repair, and consider taking a class on how to fix your bike. The lightest piece of equipment you can carry is information.
If you do need to do field repairs, you'll do a better job if you aren't cold and hangry, so take a hat, windbreaker, and a couple of granola bars.
There are lots of every ride carry lists out there that are quite good, and there have been several good threads on this site about what stuff you ought to carry.
Also, if you are riding alone in an isolated place, it is a good idea to take things easy and not be as aggressive or brave as you otherwise might be. A minor accident that would probably be a humorous recollection in a built-up area might be more like a Jack London story in the outback.