The slope of any horizontal line is always zero due to the fact all y coordinates on this line are the same. When we pick two points from the line, the same y coordinates subtract to 0. We can have 0 in the numerator, but not in the denominator.
As the slope formula shows, we basically subtract the y coordinates together, and do the same for the x coordinates as well in the same order. Then we divide the differences.