If you graph the distance an object has gone at several instants of time, then the slope of the graph at any place on it IS the speed of the object at that instant.
If the object holds a constant speed, then the distance/time graph is a straight line, whose slope is equal to the speed.
If the object's speed is not constant, then the graph may have curves in it. Still, it has a slope at every point ... the slope of a ruler that you might lay down on the curved line at that point ... and the slope is the object's speed at that point in time.
If the object is standing still and not moving, then its distance doesn't change as time goes on. The distance graph is flat/horizontal as long as the object stays where it is ... the slope of that part of the graph is zero ... the object's speed again.