If your odometer works, figure your average gas milage and how much your tank will hold. Let's say you average 26 MPG and your tank will hold 14 gallons when you are empty. You can get an average of about 364 miles on a tank. Fill up, check your odometer and fill up again before you get much over 325 miles on the tank and you should never run out.
Or, do like me and just carry a 2 1/2 gallon can of gas with you. When you run out, pour in the 2 1/2 gallons and start looking for a gas station . . . and when you fill your tank, fill your can back up for the next time . That method works every time without a working gas gauge or odometer.
OR, you could do something crazy like fix the gauge . . . but where's the fun in that?
