Let's re-write the ODE as a first-order system:
$$\begin{align*}
y_1 &= y\\
y_2 &= y' \\
y'_1 &= y_2 \\
y'_2 &= -2y_1.
\end{align*}$$
This is a linear system, so let's let $\mathbf{y} = \begin{pmatrix} y_1 \\ y_2 \end{pmatrix}$. Then,
$$\mathbf{y}' = \underbrace{\begin{pmatrix} 0 & 1 \\ -2 & 0 \end{pmatrix}}_{=A} \mathbf{y}.$$
Now, we can use the matrix exponential to solve this ODE in the usual way, but rather let's explore the characteristic equation of the matrix $A$:
$$A-\lambda I = \begin{pmatrix} -\lambda & 1 \\ -2 & -\lambda\end{pmatrix}$$ and $$
\det (A-\lambda I) = (-\lambda)^2 + 2.$$
Setting this equal to zero, we get
$$\lambda^2 +2 = 0,$$
which is precisely the characteristic equation obtained through the "traditional" method of converting derivatives of $y$ to powers of $\lambda$.