Write the equation of the line that passes through the (-2,1) and is perpendicular to y=5.

Okay, I don't understand how I can do this without a slope.

y = 5 or

y = 0x + 5 , has a slope of zero and is a horizontal line
so the perpendicular must be a vertical line, but
you probably have learned that a vertical line has an undefined slope.

It helps to know that any horizontal line has the form
y = k, where k is the y value of all the points on the horizontal line (they would all be the same)

the equation of a vertical line is x = k, were k is the x value of all the points on that vertical line.

so all we have to do is "look at" the given point,
and we see that the x value is -2

so the equation is simply
x = -2