Theorem: There is a unitary matrix $M=U$ such that $U^{-1}AU=T$ is triangular. The eigenvalues of $A$ appear along the diagonal of this similar matrix $T$.
Proof)
Every matrix, for example 4 by 4, has at least one eigenvalue $\lambda_1$. Therefore $A$ has at least one unit eigenvector $x_1$, which we place in the first column of $U$. At this stage the other three columns are impossible to determine, so we complete the matrix in any way that leaves it unitary and call it $U_1$. (The gram-schmidt process guarantees that this can be done) $Ax_1=\lambda_1x_1$ in column 1 means that the product $U_1^{-1}AU_1$ starts in the right form.
$AU_1=U_1\begin{pmatrix} \lambda_1 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \end{pmatrix}$ leads to $U_1^{-1}AU_1=\begin{pmatrix} \lambda_1 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \end{pmatrix}$
Now work with the 3 by 3 submatrix which has a unit eigenvector $x_2$ and it becomes the first column of a unitary matrix $M_2$.
If $U_2=\begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & & & \\ 0 & & M_2 & \\ 0 & & & \end{pmatrix}$ then $U_2^{-1}(U_1^{-1}AU_1)U_2=\begin{pmatrix} 1 & * & * & * \\ 0 & \lambda_2 & * & * \\ 0 & 0 & * & * \\ 0 & 0 & * & * \end{pmatrix}$
In here, I can't follow the logic.
Why $AU_1=U\begin{pmatrix} \lambda_1 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \\ 0 & * & * & * \end{pmatrix}$ ? It used the formula $Ax_1=\lambda_1x_1$?
Also, why $U_2^{-1}(U_1^{-1}AU_1)U_2=\begin{pmatrix} 1 & * & * & * \\ 0 & \lambda_2 & * & * \\ 0 & 0 & * & * \\ 0 & 0 & * & * \end{pmatrix}$ ?
I even don't know what's going on here...
Can you explain the process through which we can get the final matrix T?