Displacement is the final position of the object minus the initial position of the object.
Xf - Xi. Displacement is not the distance of the object. If you go to the right 10m and to the left another 10m, your displacement is 0m. But your distance is 20m