As another inexperienced pilot, I too have trouble "seeing how it happens". I know the fuel burn because I've read the POH and talked to the owner; I check the log, then I check the fuel gauges (having ascertained from the owner how trustworthy they are), then I dip the tanks, and if all three don't agree that I've got more fuel than I need then I refuel. If I can't find the refueller, or I'm going to run out of time, then I don't fly.
But, people who know more about it, and must be being at least as careful as me, still run out of fuel. So, to avoid it happening to me, can someone tell me which bit of that am I doing wrong? What else should I do? And, if everybody else does the same, how come I've once or twice (no more often than that, let's be fair) picked up a rental plane and found only half an hour in the tanks?