let me try to recall the proof. consider $G_1\times G_2$ with $|G_1|,|G_2|$ coprime and let $H\le G_1\times G_2$ be a subgroup. denote $H_1,H_2$ the projections of $H$ to $G_1,G_2$ respectively. obviously, $H\subseteq H_1\times H_2$. now take $(h_1,h_2)\in H_1\times H_2$. by definition, we can find $g_2\in G_2,g_1\in G_1$ such that $(h_1,g_2),(g_1,h_2)\in H$.
Now, by Bezout, we can find integers $x,y$ s.t. $x|G_1|+y|G_2|=1$, then $(h_1,g_2)^{y|G_2|}=(h_1,1)$ and $(g_1,h_2)^{x|G_1|}=(1,h_2)$, so that $(h_1,h_2)=(h_1,g_2)^{y|G_2|}(g_1,h_2)^{x|G_1|}\in H$.