distance is a scalar quantity while displacement is a vector.
a person could walk 5 meters forward and then 2 meters back. the person’s distance is 7 meters and their displacement would be 3 meters.
basically distance is the total space covered while displacement is the space of the starting and final points.