Calculate the amount of fuel needed to finish your race without running dry, the number of pit stops to plan and the stint split, based on your fuel per lap and tank capacity.
Drive a few laps at race pace (not on a formation lap or out-lap) then note the fuel used divided by the number of laps completed. Most games and SimHub apps show this figure directly in telemetry.
The formation lap, a caution period (Safety Car / Virtual Safety Car) or simply a faster pace than expected use more fuel than anticipated. A few laps of margin avoid running dry a few meters from the finish.
Indicative calculation based on constant consumption; adjust according to actual race pace and weather.