The technique is predicated upon drawing a decision boundary line leaving as ample a margin to the first positive and negative examples as possible:

As in the illustration above, if we select an orthogonal vector such that $ \lVert w \rVert=1$ we can establish a decision criterion for any unknown example $\mathbf u$ to be catalogued as positive of the form:
$$ \color{blue}{\mathbf w} \cdot {\mathbf u} \geq C$$
corresponding to a value that would place the projection beyond the decision line in the middle of the street. Notice that $\color{blue}{\mathbf w} \cdot {\mathbf u} = {\mathbf u} \cdot \color{blue}{\mathbf w}$.
An equivalent condition for a positive sample would be:
$$\color{blue}{\mathbf w}\cdot \mathbf u + b \geq 0 \tag 1$$
with $C = - b.$
We need $b$ and $\color{blue}{\mathbf w}$ to have a decision rule, and to get there we need constraints.
First constraint we are going to impose is that for any positive sample $\mathbf x_+,$, $\color{blue}{\mathbf w}\cdot \mathbf x_+ + b \geq 1$; and for negative samples, $\color{blue}{\mathbf w}\cdot \mathbf x_- + b \leq -1$. In the division boundary or hyperplane (median) the value would be $0$, while the values at the gutters will be $1$ and $-1$:

The vector $\bf w$ is the weights vector, whereas $b$ is the bias.
To bring these two inequalities together, we can introduce the variable $y_i$ so that $y_i=+1$ for positive examples, and $y_i=-1$ if the examples are negative, and conclude
$$ y_i (x_i\cdot \color{blue}{\mathbf w} + b) -1\geq 0.$$
So we establish that this has to be greater than zero, but if the example is on the hyperplanes (the "gutters") that maximize the margin of separation between the decision hyperplane and the tips of the support vectors, in this case lines), then:
$$ y_i \,(x_i\cdot \color{blue}{\mathbf w} + b) -1 = 0\tag 2$$
Notice that this is equivalent to requiring that $y_i \,(x_i\cdot \color{blue}{\mathbf w} + b) = 1.$

Second constraint: the distance of the decision hyperplane to the tips of the support vectors will be maximized. In other words the margin of separation ("street") will be maximized:

Assuming a unit vector perpendicular to the decision boundary, $\mathbf w$, the dot product with the difference between two "bordering" plus and minus examples is the width of "the street":
$$ \text{width}= (x_+ \,{\bf -}\, x_-) \cdot \frac{w}{\lVert w \rVert}$$
On the equation above $x_+$ and $x_-$ are in the gutter (on hyperplanes maximizing the separation). Therefore, for the positive example: $ ({\mathbf x_i}\cdot \color{blue}{\mathbf w} + b) -1 = 0$, or $ {\mathbf x_+}\cdot \color{blue}{\mathbf w} = 1 - b$; and for the negative example: $ {\mathbf x_-}\cdot \color{blue}{\mathbf w} = -1 - b$. So, reformulating the width of the street:
$$\begin{align}\text{width}&=(x_+ \,{\bf -}\, x_-) \cdot \frac{w}{\lVert w \rVert}\\[1.5ex]
&= \frac{x_+\cdot w \,{\bf -}\, x_-\cdot w}{\lVert w \rVert}\\[1.5ex]
&=\frac{1-b-(-1-b)}{\lVert w \rVert}\\[1.5ex]
&= \frac{2}{\lVert w \rVert}\tag 3 \end{align}$$
So now we just have to maximize the width of the street - i.e. maximize $ \frac{2}{\lVert w \rVert},$ minimize $\lVert w \rVert$, or minimize:
$$\frac{1}{2}\;\lVert w \rVert^2 \tag 4$$
which is mathematically convenient.
So we want to:
Minimise $\lVert w\rVert^2$ with the constraint:
$y_i(\mathbf w \cdot \mathbf x_i + b )-1=0$
Since we want to minimise this expression based on some constraints, we need a Lagrange multiplier (going back to equations 2 and 4):
$$ \mathscr{L} = \frac{1}{2} \lVert \mathbf w \rVert^2 - \sum \lambda_i \Big[y_i \, \left( \mathbf x_i\cdot \color{blue}{\mathbf w} + b \right) -1\Big]\tag 5$$
Differentiating,
$$ \frac{\partial \mathscr{L}}{\partial \color{blue}{\mathbf w} }= \color{blue}{\mathbf w} - \sum \lambda_i \; y_i \; \mathbf x_i = 0$$.
Therefore,
$$\color{blue}{\mathbf w} = \sum \lambda_i \; y_i \; \mathbf x_i\tag 6$$
And differentiating with respect to $b:$
$$ \frac{\partial \mathscr{L}}{\partial b}=-\sum \lambda_i y_i = 0,$$
which means that we have a zero sum product of multipliers and labels:
$$ \sum \lambda_i \, y_i = 0\tag 7$$
Pluging equation Eq (6) back into Eq (5),
$$ \mathscr{L} = \frac{1}{2} \color{purple}{\left(\sum \lambda_i y_i \mathbf x_i \right) \,\left(\sum \lambda_j y_j \mathbf x_j \right)}- \color{green}{\left(\sum \lambda_i y_i \mathbf x_i\right)\cdot \left(\sum \lambda_j y_j \mathbf x_j \right)} - \sum \lambda_i y_i b +\sum \lambda_i$$
The penultimate term is zero as per equation Eq (7).
Therefore,
$$ \mathscr{L} = \sum \lambda_i - \frac{1}{2}\displaystyle \sum_i \sum_j \lambda_i \lambda_j\,\, y_i y_j \,\, \mathbf x_i \cdot \mathbf x_j\tag 8$$
Eq (8) being the final Lagrangian.
Hence, the optimization depends on the dot product of pairs of examples.
Going back to the "decision rule" in Eq (1) above, and using Eq (6):
$$ \sum\; \lambda_i \; y_i \; \mathbf x_i\cdot \mathbf u + b \geq 0\tag 9$$
will be the final decision rule for a new vector $\mathbf u.$