Let's assume that we are crossing the Atlantic (about 3,878 miles) with a 737-8 MAX. How can we calculate the fuel that we will use during our flight?
You need to know the fuel burn per distance covered which depends, among other things, on aircraft weight, speed, altitude and wind (all of which probably change over time), and then you add it up over the trip distance for the planned route (which is likely to differ from shortest possible great circle route for various reasons like airspace organisation and weather). As mentioned by OverD, regulations require some extra bits on top to cover for unforeseen circumstances. As also observed by OverD, this is also dependent on the individual aircraft - e.g. old engines might need more fuel than new ones, a dent in the fuselage might create additional drag, an inoperative component might require extra fuel or off-optimum altitude etc. etc.
The manufacturer, in your example Boeing, provides the aircraft‘s performance data (e.g. fuel mileage etc.) to the operators.
I agree with Cpt Reynolds however there are more factors that come to play, such as the technical status of the aircraft (some issues require extra fuel uplift), the age of the engines (performance factor).
And a major part is regulation, almost always you require additional fuel to proceed to an alternate airport, plus additional fuel to fly for an extra 30 mins and you require 3-5% of you original fuel as inflight reserve. And not forget the fuel required to taxi the airplane and use the APU.
But if you factor all the above out Cpt Reynolds answer is spot on