Theory
Perpendicular lines meet at a right angle. For two non-vertical lines, their gradients are negative reciprocals: if one gradient is m, the other is -1/m. The product of the gradients is -1.
A reciprocal swaps numerator and denominator, and the negative sign changes direction. Gradient 2 is 2/1, so its perpendicular gradient is -1/2. Gradient -3/4 gives perpendicular gradient 4/3.
The diagram shows gradients 2 and -1/2 meeting at a right angle. The first rises 2 for 1 right; the second falls 1 for 2 right. Their product is 2 x (-1/2) = -1.
To find an equation, first change the gradient, then use a point to find the intercept. A line perpendicular to y = 2x + 1 through (0, 1) has gradient -1/2 and intercept 1, so y = -x/2 + 1.
Horizontal and vertical lines are a special pair: y = 3 is perpendicular to x = 2. A vertical line has undefined gradient, so do not use -1/m when m = 0 or for a vertical line.