Remember this is a general rule of thumb as your fuel economy is not a constant and will vary for a number of factors. But the method is exactly the same, regardless.
1. Fill your tank to maximum (knowing what your tank's capacity is - say 50 litres).
2. Re-set your trip mileometer before setting off.
3. Drive the car as you would normally until the fuel light illuminates, then refuel to maximum (noting the amount of fuel you put in, and the distance you have travelled).
4. Time for the calculation, say you put in 40 litres when refuelling, and that you covered say, 450 miles, that means that every 1 litre took you 450/40 = 11.25 miles. You know you had 10 litres left when you refuelled, so you could have (theoretically) travelled a further 112.5 miles before the tank was completely drained.
Remember, as previously stated, this is not advised to put into practice, as dirt and air locks in the fuel system can cause major problems if the tank runs low/empty.
You should after a couple of fills have an idea how far you should be able to comfortably travel on a tank, and plan your fuel stops accordingly.