Explanation:
the typical equation is the slope-intercept form :
y = ax + b
"a" being the slope, "b" being the y-intercept (the y-value, when x = 0).
the slope is the ratio
y coordinate difference / x coordinate difference
when going from one point on the line to another.
going from (-2, -6) to (-2, -2) (we could go also in the other direction and get the same result) :
x changes by 0 (from -2 to -2).
y changes by +4 (from -6 to -2).
the slope is then +4/0 = uh oh !
that is undefined (or often called infinite).
in other words, this is a vertical line going through x = -2.
and that is already the equation for the line :
x = -2
there is no way to define it by
y = ...
because every possible y-value is a possible solution with x = -2
in other words, all points (-2, y) together are this line.
and therefore, there is also no y-intercept. the line is parallel to the y-axis and never intercepts it.