Let $H,K$ be two subgroups of a group $(G,\cdot)$.
We consider the relation $\sim$ defined on $G$ by :
\begin{equation}
x \sim y \iff \exists (h,k) \in H \times K, \; y=hxk
\end{equation}
It's easy to verify that $\sim$ is an equivalence relation on $G$.
We are told to show that, if $H$ and $K$ are finite, then every equivalence class modulo $\sim$ is finite and its cardinality divides $|H||K|$.
For that we are told to consider, f or all $x$ in $G$:
\begin{equation} G_x=\{ (h,k) \in H \times K \; : \; hxk^{-1}=x \} \end{equation}
which is a subgroup of the product group $H \times K$.
From this, I can see that we'll have to relate the cardinality of $G_x$ and the equivalence class of $x$ and use Lagrange's theorem. However I don't see how to make that connection.
About the finiteness, it would suffice to note that, by definition, $[x]_\sim=\{hxk∣h∈H,k∈K\}$, whence ${\rm{card}}([x]_\sim)≤|H||K|$, due to the possible repetitions of the product $hxk$ in the RHS.
To get more insight, note that $(h,k)\cdot x:=hxk^{-1}$ is an action of $H\times K$ on $G$; in fact, $\forall x\in G$ and $\forall (h,k),(h',k')\in H\times K$: $$(e,e)\cdot x = exe^{-1}=exe=xe=x$$ and \begin{alignat}{1} (h,k)\cdot((h',k')\cdot x) &= (h,k)\cdot h'xk'^{-1} \\ &= h(h'xk'^{-1})k^{-1} \\ &=(hh')x(k'^{-1}k^{-1}) \\ &=(hh')x(kk')^{-1} \\ &=(hh',kk')\cdot x \\ &=((h,k)(h',k'))\cdot x \\ \end{alignat} With this at hand, you can recognize that $[x]_\sim$ and $G_x$ are respectively the orbit and the stabilizer of $x\in G$ for this action, and the claim follows then from the orbit-stabilizer theorem.