Are you concerned about the bike or running out of energy? Like others have said, keep your bike in good shape and learn how to make minor repairs.
I don't carry a phone and I've gone on some remote rides where there are no stores. If I'm going to be in such an area I will carry extra food and water. If it's going to be hot I will carry a Camelbak along with 2 bottles.
I think it's rare that a well maintained bike will break down and be unrideable.