With a clock. Fuel burns by the clock (cc/min), not by the gauge. Gauges are notoriously inaccurate. So you must put a measured amount of fuel in your tanks, fly it for a time, then measure the fuel used so you know what the fuel burn is. If you know the capacity of your tanks, then you know how long it will fly
As with full size aircraft, you have to flight test it and determine that. Gauges are not relied on in full-size. Look at the flight manual and you’ll see graphs and charts for fuel burn vs speed, density altitude and percentage power settings. It is up to the pilot to plan the flight based on the tested data of the aircraft. And when he/she files the flight plan with ATC, the fuel onboard is given in hours and minutes, not gallons or liters.
Only in the movies to make it dramatic do they tap on the fuel gauge with the needle pointing at “E” and go “oh no, we’re gonna crash”.
So you take your helicopter out and fly it on various shorter flights, measure the fuel burned, to develop your own fuel burn charts so you can flight plan accordingly for longer flights.