I am trying to figure out if this equation is correct?

My second equation that I am using is: y=-1/2x+1, and the perpendicular must pass through this given point (4, 2).

y-y=m(x-y)
y-2=2(x-4) perpendicular lines have to have slopes, so
y-2=2x-8
y-2+2=2x-8+2 reciprocal
y=2x-6 my answer in slope-intercept form

assume you mean

y = (-1/2) x + 1
slope m = -1/2
so
slope of perpendicular = -1/m = 2
y = 2 x + b
put in point
2 = 2(4) + b
b = -6
so I agree
y = 2 x - 6
You are getting these right but not the way I do them and I have not figured out what you are doing yet.