The midpoint of the line segment through $(x_1,y_1)$ and $(x_2,y_2)$ is $\left({x_1+x_2\over 2},{y_1+y_2\over 2}\right)$.
Also, perpendicular lines have negative reciprocal slopes, so if you want a line perpendicular to a line with slope $m$, you want to use a slope of $-{1\over m}$.
Finally, use the point-slope formula for the equation of a line through, say, $(x_3,y_3)$ with slope $m$: $y-y_3=m(x-x_3)$.
So, for example, if you want the perpendicular bisector to the segment through $P(x_1,y_1)$ and $Q(x_2,y_2)$:
- The midpoint is $\left({x_1+x_2\over 2},{y_1+y_2\over 2}\right)$.
- The slope of $\overline{PQ}$ is $m={y_2-y_1\over x_2-x_1}$, so the slope of a perpendicular is $-{1\over m}={x_1-x_2\over y_2-y_1}$.
- Finally, the equation of the perpendicular bisector of $\overline{PQ}$ is then $$y- {y_1+y_2\over 2}={x_1-x_2\over y_2-y_1}\left(x-{x_1+x_2\over 2}\right).$$