Check your manual and see how much your tank holds. As soon as the petrol pump lights up, fill up. Try to put as much fuel in your tank as possible and get the same quantity each time. Take away fuel filled from tank max and you have whats approximately left when the light comes on. Always reset your odometer to zero so you have a good idea of your consumption and can get a better estimate of how the car is consuming fuel.
I always try to do the right thing and fill up and reset the odometer, so as I know rough miles I have to drive and what's left after the red light comes on. Good tip really. :)