We use the separation of variables method and look for arbitrary periodic solutions; that is, vibrations of the form
$$(21.3) \qquad\qquad\qquad u(x,t)=X(x)[A \sin(\omega t)+B \cos(\omega t)].$$
Note that by choosing the solution in the form (21.3), we are essentially saying that the separation constant in the separation-of-variables method has been chosen to be negative.
We now substitute equation (21.3) into the beam equation to get the ODE in $X(x)$.
$$X^{iv}-\omega^2 X=0,$$
which has the general solution
$$X(x)=C \cos\left(\sqrt{\omega} \, x\right)+D \sin\left(\sqrt{\omega} \, x\right)+E \cosh\left(\sqrt{\omega} \, x\right)+F \sinh\left(\sqrt{\omega} \, x\right).$$
To find the constants $C, D, E,$ and $F,$ we substitute this expression into the BCs, giving
\begin{align*}
u(0,t)&=0 \implies X(0) T(t)=0 \implies X(0)=0 \implies C+E=0 \\
u_{xx}(0,t)&=0 \implies X''(0) T(t)=0 \implies X''(0)=0 \implies -C+E=0,
\end{align*}
which together imply that $C=E=0$.
\begin{align*}
u(1,t)&=0\implies D\sin\left(\sqrt{\omega}\right)+F\sinh\left(\sqrt{\omega}\right)=0 \\
u_{xx}(1,t)&=0\implies -D\sin\left(\sqrt{\omega}\right)+F\sinh\left(\sqrt{\omega}\right)=0.
\end{align*}
From these last two equations, we arrive at the expressions
\begin{align*}
F\sinh\left(\sqrt{\omega}\right)&=0 \\
D \sin\left(\sqrt{\omega}\right)&=0
\end{align*}
from which we can conclude
\begin{align*}
F&=0 \\
\sin\left(\sqrt{\omega}\right)&=0 \implies \omega=(n\pi)^2,\quad n=1,2,\dots
\end{align*}
In other words, the natural frequencies of the simply supported beam are
$$\omega_n=(n\pi)^2$$
and the fundamental solutions $u_n$ (solutions of the PDE and BCs) are
$$u_n(x,t)=X_n(x) T_n(t)=\left(a_n \sin\left[(n\pi)^2 t\right]+b_n \cos\left[(n\pi)^2t\right] \right) \sin(n\pi x).$$
Now, since the PDE and BCs are linear and homogeneous, we can conclude that the sum
$$(21.4) \qquad\qquad\qquad\boxed{u(x,t)=\sum_{n=1}^{\infty}\left(a_n \sin\left[(n\pi)^2 t\right]+b_n \cos\left[(n\pi)^2t\right] \right) \sin(n\pi x)} $$
also satisfies the PDE and BCs. Hence, all that remains to do is choose the constants $a_n$ and $b_n$ in such a way that the ICs are satisfied. Substituting equation (21.4) into the ICs gives us
\begin{align*}
u(x,0)&=f(x)=\sum_{n=1}^{\infty}b_n \sin(n\pi x) \\
u_t(x,0)&=g(x)=\sum_{n=1}^{\infty}(n\pi)^2 a_n \sin(n\pi x),
\end{align*}
and using the fact that the family $\{\sin(n\pi x)\}$ is orthogonal on the interval $[0,1]$ gives us
\begin{align*}
a_n&=\frac{2}{(n\pi)^2} \int_0^1 g(x) \, \sin(n\pi x) \, dx \\
b_n&=2\int_0^1 f(x) \, \sin(n\pi x) \, dx.
\end{align*}
Hence, the solution is given by (21.4), and $a_n$ and $b_n$ are given by the last two equations.