You can think of this as a vector problem in $\mathbb{C}^{n}$. You're trying to minimize
$$
F(\lambda)=\|z-\lambda w\|^{2}=\sum_{j=1}^{n}|z_{j}-\lambda w_{j}|^{2}.
$$
By finding the $\lambda_{0}$ such that $F(\lambda) \ge F(\lambda_{0})$ you get the tightest inequality $F(\lambda_{0}) \ge 0$, which turns out to be the Cauchy-Schwarz inequality, and equality holds iff $z=\lambda_{0} w$.
This is the Complex version of the old Calculus problem of projecting $z$ onto the complex line $l=\{ \lambda w : \lambda \in \mathbb{C}\}$. The closest point projection of a point onto the line is the same as the orthogonal projection. That is,
$$
(z-\lambda w)\cdot w = 0,
$$
where "$\cdot$" is the vector dot product in $\mathbb{C}^{n}$ given by $a\cdot b=\sum_{j}a_{j}\overline{b_{j}}$. Assuming $w$ is not the $0$ vector,
$$
z\cdot w = \lambda |w|^{2} \implies \lambda = \frac{z\cdot w}{\|w\|^{2}}
= \frac{\sum_{j=1}^{n}z_{j}\overline{w_{j}}}{\sum_{j=1}^{n}|w_{j}|^{2}}.
$$
Now plug $\lambda=\frac{z\cdot w}{w\cdot w}$ in to get minimum distance of $z$ to the complex line $\{ \lambda w : \lambda \in\mathbb{C}\}$:
$$
%% \begin{align}
0 \le \|z-\lambda w\|^{2} =(z-\lambda w)\cdot(z-\lambda w) =\|z\|^{2} - \frac{|w\cdot z|^{2}}{\|w\|^{2}}
%% & =(z-\lambda w)\cdot z-(z-\lambda w)\cdot w \\
%% & =(z-\lambda w)\cdot z \\
%% & = \|z\|^{2}-\lambda w\cdot z \\
%% & = \|z\|^{2} - \frac{z\cdot w}{\|w\|^{2}}(w\cdot z) \\
%% & = \|z\|^{2} - \frac{|w\cdot z|^{2}}{\|w\|^{2}}.
%% \end{align}
$$
Therefore, $|z\cdot w| \le \|z\|\|w\|$, and equality holds iff $z=\lambda w$ is already on the line.