The first problem is that you are judging the amount of gas left in your tanks using the gauges. As I am sure you are aware, GA airplane fuel quantity indicators are notoriously inaccurate.
The way I always did it was to figure out my endurance before I ever left the ground, allowing for taxi, climb, cruise and descent. I started my time at the beginning of my takeoff role and watched the time carefully throughout the flight. I kept an eye on the gauges as well, careful to note any possible extra fuel consumption.
Thinking of gas as minutes in your tanks as opposed to gallons may clear up any situational awareness problems that you may have. Don't for get to lean the engine per the instructions in the POH.