First, we have to know that if 2 lines are perpendicular, the product of their gradients is -1.
Next, we have to express the 2 equations in similar ways by rearranging them and making y the common subject.
The line AB has equation y = -6x + 5, and the second is just y = mx + 1.
From here, since both lines are of the form y = mx + c, where m is the gradient and c is the intercept, we can see that the gradient of the first line is -6, and the second line is m.
Since the product of these 2 gradients is -1, we know that
-6 x m = -1
Therefore m = 1/6