How can we calculate the fuel that we need?
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.