Define the surjective function
\begin{align*}
\phi \colon G/K \amp\to G/H\\
xK \amp\mapsto xH
\end{align*}
To see this function is well-defined, assume
\begin{equation*}
x_1K = x_2K \iff x_1^{-1}x_2 \in K \leq H\text{.}
\end{equation*}
Hence \(\phi(x_1K) = x_1H = x_2H = \phi(x_2K)\text{.}\)
Since \(\phi\) is a function, we note that if \(y_1H \neq y_2H\text{,}\) then \(\phi^{-1}(y_1H) \cap \phi^{-1}(y_2H) = \emptyset\text{.}\) If \(y_1H, \ldots, y_rH\) are the distinct elements of \(G/H\text{,}\) then we can write
\begin{equation*}
G/K = \bigsqcup_{i=1}^r \phi^{-1}(y_iH)\text{.}
\end{equation*}
Hence it suffices to prove that for all \(yH \in G/H\text{,}\) there is a bijection \(H/K \to \phi^{-1}(yH)\text{,}\) for then
\begin{align*}
\abs{G : K} \amp= \abs{G/K}\\
\amp= \sum_{i=1}^r \abs{\phi^{-1}(y_iH)}\\
\amp= \sum_{i=1}^r \abs{H/K}\\
\amp= r\abs{H/K}\\
\amp= \abs{G:H}\abs{H:K}\text{.}
\end{align*}
Let \(yH \in G/H\) be given. Define the function
\begin{align*}
\psi \colon H/K \amp\to \phi^{-1}(yH)\\
xK \amp\mapsto (yx)K\text{.}
\end{align*}
To see this function is well-defined and injective it suffices to observe that
\begin{align*}
x_1K = x_2K \amp\iff x_1^{-1}x_2 \in K\\
\amp\iff x_1^{-1}(y^{-1}y)x_2 \in K\\
\amp\iff (yx_1)^{-1}(yx_2) \in K\\
\amp\iff (yx_1)K = (yx_2)K\\
\amp\iff \psi(x_1H) = \psi(x_2H)\text{.}
\end{align*}
To see that \(\psi\) is surjective, let \(xK \in \phi^{-1}(yH)\) be given. Observe that
\begin{equation*}
yH = \phi(xK) = xH \iff y^{-1}x \in H
\end{equation*}
implies
\begin{equation*}
\psi\left(y^{-1}xK\right) = \left(y\left(y^{-1}x\right)\right)H = xH\text{.}
\end{equation*}
Therefore \(\psi\) is a bijection and thus
\begin{equation*}
\abs{G:K} = \abs{G:H}\abs{H:K}\text{.}
\end{equation*}