We start with the Electromagnetic wave equations
\begin{align}
\nabla^2\mathbf E\boldsymbol{-} \dfrac{1}{c^2}\dfrac{\partial^2 \mathbf E}{\partial t^2}& \boldsymbol{=}\boldsymbol{0}
\tag{01a}\label{01a}\\
\nabla^2\mathbf B\boldsymbol{-} \dfrac{1}{c^2}\dfrac{\partial^2 \mathbf B}{\partial t^2}& \boldsymbol{=}\boldsymbol{0}
\tag{01b}\label{01b}
\end{align}
where $\mathbf E\boldsymbol{=}\mathbf E\left(x,y,z,t\right)$ , $\mathbf B\boldsymbol{=}\mathbf B\left(x,y,z,t\right)$ are functions of the space-time coordinates and $1/c^2\boldsymbol{=}\mu\epsilon$.
Now for an electromagnetic wave propagating in the $z-$direction and oriented alone the $x-$axis we have
\begin{equation}
\mathbf E\left(x,y,z,t\right)\boldsymbol{=}\mathrm E_{x}\left(z,t\right)\mathbf i
\tag{02}\label{02}
\end{equation}
where $\mathbf i$ the unit vector along the $x-$axis. Equation \eqref{01a} yields
\begin{equation}
\dfrac{\partial^2 \mathrm E_{x}}{\partial z^2}\boldsymbol{-} \dfrac{1}{c^2}\dfrac{\partial^2 \mathrm E_{x}}{\partial t^2} \boldsymbol{=}0
\tag{03}\label{03}
\end{equation}
The general solution of this wave equation is not something new, you could find it in many textbooks on electromagnetics, on the web, here in this site etc. But I'll sketch in summary a proof to realize that what you are missing here is the time dependence part which prevents you from understanding the $''$travelling$''$ of the wave, forward or backward.
The first step is to consider that $\mathrm E_{x}\left(z,t\right)$ is the product of a function of space coordinates, here $z$, and a function of time $t$ as follows
\begin{equation}
\mathrm E_{x}\left(z,t\right) \boldsymbol{=}\mathcal E\left(z\right)\mathcal T\left(t\right)
\tag{04}\label{04}
\end{equation}
Then from equation \eqref{03} we have
\begin{equation}
T\left(t\right)\dfrac{\mathrm d^2 \mathcal E\left(z\right)}{\mathrm dz^2}\boldsymbol{-}\dfrac{1}{c^2}\mathcal E\left(z\right)\dfrac{\mathrm d^2 \mathcal T\left(t\right)}{\mathrm dt^2}\boldsymbol{=}0
\nonumber
\end{equation}
that is
\begin{equation}
c^2\dfrac{1}{\mathcal E\left(z\right)}\dfrac{\mathrm d^2 \mathcal E\left(z\right)}{\mathrm dz^2}\boldsymbol{=}\dfrac{1}{T\left(t\right)}\dfrac{\mathrm d^2 \mathcal T\left(t\right)}{\mathrm dt^2}
\tag{05}\label{05}
\end{equation}
Since the lhs is a function of $z$ only and the rhs is a function of $t$ only then both must be a constant
\begin{equation}
c^2\dfrac{1}{\mathcal E\left(z\right)}\dfrac{\mathrm d^2 \mathcal E\left(z\right)}{\mathrm dz^2}\boldsymbol{=}\boldsymbol{-}\omega^2\boldsymbol{=}\dfrac{1}{T\left(t\right)}\dfrac{\mathrm d^2 \mathcal T\left(t\right)}{\mathrm dt^2}\,,\qquad \omega\in \mathbb C
\tag{06}\label{06}
\end{equation}
yielding a system of two linear differential equations of 2nd order
\begin{align}
\dfrac{\mathrm d^2 \mathcal T\left(t\right)}{\mathrm dt^2}\boldsymbol{+}\omega^2 \mathcal T\left(t\right)& \boldsymbol{=}0
\tag{07a}\label{07a}\\
\dfrac{\mathrm d^2 \mathcal E\left(z\right)}{\mathrm dz^2}\boldsymbol{+}\left(\dfrac{\omega}{c}\right)^2\mathcal E\left(z\right)& \boldsymbol{=}0
\tag{07b}\label{07b}
\end{align}
and defining
\begin{equation}
\mathrm k\boldsymbol{\equiv}\dfrac{\omega}{c}
\tag{08}\label{08}
\end{equation}
we have
\begin{align}
\dfrac{\mathrm d^2 \mathcal T\left(t\right)}{\mathrm dt^2}\boldsymbol{+}\omega^2 \mathcal T\left(t\right)& \boldsymbol{=}0
\tag{09a}\label{09a}\\
\dfrac{\mathrm d^2 \mathcal E\left(z\right)}{\mathrm dz^2}\boldsymbol{+}\mathrm k^2\mathcal E\left(z\right)& \boldsymbol{=}0
\tag{09b}\label{09b}
\end{align}
with general solutions respectively(1)
\begin{align}
\mathcal T\left(t\right) & \boldsymbol{=} \mathrm A_1\, e^{\boldsymbol{+}i\,\omega\,t}\boldsymbol{+}\mathrm A_2\, e^{\boldsymbol{-}i\,\omega\,t}
\tag{10a}\label{10a}\\
\mathcal E\left(z\right) & \boldsymbol{=}\mathrm B_1\, e^{\boldsymbol{+}i\,\mathrm k\,z}\boldsymbol{+}\mathrm B_2\, e^{\boldsymbol{-}i\,\mathrm k\,z}
\tag{10b}\label{10b}
\end{align}
giving the following general solution of \eqref{03}
\begin{equation}
\mathrm E_{x}\left(z,t\right) \boldsymbol{=}\left[\mathrm C_1\, e^{i\left(\mathrm k\,z\boldsymbol{+}\omega\,t\right)}\boldsymbol{+}\mathrm C_2\, e^{\boldsymbol{-}i\left(\mathrm k\,z\boldsymbol{+}\omega\,t\right)}\right]\boldsymbol{+}\left[\mathrm D_1\, e^{i\left(\mathrm k\,z\boldsymbol{-}\omega\,t\right)}\boldsymbol{+}\mathrm D_2\, e^{\boldsymbol{-}i\left(\mathrm k\,z\boldsymbol{-}\omega\,t\right)}\right]
\tag{11}\label{11}
\end{equation}
If $\,\mathrm k \in \mathbb R\,$ then in order to be $\,\mathrm E_{x}\left(z,t\right) \in \mathbb R\,$ we must have
\begin{equation}
\mathrm C_1\boldsymbol{=}\mathrm C_2\boldsymbol{=}\tfrac12\mathrm E^{\boldsymbol{+}}_{0z} \in \mathbb R\,,\qquad \mathrm D_1\boldsymbol{=}\mathrm D_2\boldsymbol{=}\tfrac12\mathrm E^{\boldsymbol{-}}_{0z}\in \mathbb R
\tag{12}\label{12}
\end{equation}
giving
\begin{equation}
\mathrm E_{x}\left(z,t\right)\boldsymbol{=}\mathrm E^{\boldsymbol{+}}_{0z}\cos\left(\mathrm k\,z\boldsymbol{+}\omega\,t\right)\boldsymbol{+} \mathrm E^{\boldsymbol{-}}_{0z}\cos\left(\mathrm k\,z\boldsymbol{-}\omega\,t\right)
\tag{13}\label{13}
\end{equation}
Based on this solution the answer to your question about the travelling waves is given very well by @Vincent Thacker.
$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!$
$=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!=\!$
(1)
If you want to see how to solve this kind of differential equations without assuming a priori that the solution would be exponential or sinusoidal take a look in my answer here
Need help understanding an equation of motion for a pendulum.