Remember, if 2 lines are perpendicular, their slopes are opposite reciprocals. So if one line has a slope of 4, the other line should have a slope of -1/4.
Hopefully your equation is in y=mx+b form. If so,
make sure you know slope (m) and the y-intercept. After this is done, plug in the points from p for y and x, and make sure to turn m into -1/m. Solve for b, and your new equation should be y=(new slope)x+(new y-intercept)