The Pitot tube is a device to measure dynamic pressure (0.5 * density * v^2) of a flow based on pressure measurement. The total pressure is defined as the sum of the static pressure and of the dynamic pressure and it’s, under particular conditions (that are with good approximations verified around the device) constant. So if you measures the total pressure and then measures also the static pressure, you can calculate easily the dynamic pressure and then, knowing via other ways the density, also the airspeed v = square root (2*(total p – static p)/rho).
If you wants more details on how the tube works just ask.