Maximize the margin formula in support vector machines algorithm
The separating hyperplane that we are looking for is $w^Tx+b=0$. That is $w$ is the coefficient or the slope of the separating hyperplane and $m$ is the margin. 

By scaling, for the positive class, we want the closest data point (support vectors) to satisfies $w^Tx+b=1$ and for the negative data class, we want the closest data point to satisfies $w^Tx+b=-1$.

Recall from geometry class, (a $3$ dimensional case is discussed here) that the distance from a point $y$ from a plane $w^Tx+b=0$ is $$\frac{|w^Ty+b|}{\|w\|}.$$

Hence as a result, the distance of the closest point to the hyperplane would be $\frac{|\pm1|}{\|w\|}=\frac{1}{\|w\|}$ and hence, the margin, that is the closest distance between the two classes would be $\frac2{\|w\|}$.

We want to maximize the margin, $\frac2{\|w\|}$ which is equivalent to minimize $\frac{\|w\|}2$ which is equivalent to minimize $\frac{\|w\|^2}2$ subject to the constraints that we classify the points correctly.