Proof
Start with $G$ given as $G=G_{p_1}\times \cdots \times G_{p_m}$ with $p_i\neq p_j$ for $i\neq j$. You need to show that for every $h=(h_1,\ldots,h_m)$ every element $(0, \ldots, h_i, \ldots,0)$ belongs to $H$. This is sufficient to prove what you want but also necessary: otherwise $H$ would not be a direct product.
To show that, define $a_i=|G|/|G_{p_i}|$: this number is a multiple of every $|G_{p_j}|$ with $j\neq i$; it is coprime to $p_i$ by construction and, hence, it is also coprime to the order of $h_i$ inside $G_{p_i}$. Using this, we get $h^{a_i}=(0, \ldots, h_i^{a_i}, \ldots, 0)$ belongs to $H$. Moreover, because $\mathrm{gcd}(a_i, |h_i|)=1$, we get that $h_i$ and $h^{a_i}$ generate the same cyclic subgroup of $G_{p_i}$: it follows that $(0, \ldots, h_i, \ldots, 0)$ is also in $H$, which is what we wanted to show.