If $X_1,\ldots, X_m$ are compact metric spaces and $X=X_1\times\cdots\times X_m$ then consider a sequence
$$(A_n)=(a^1_n, \ldots, a^m_n)\subseteq X$$
Now pick a convergent subsequence $(a^1_{n_k})$ of $(a^1_n)$ and take a subsequence
$$(A_{n_k})=(a^1_{n_k}, \ldots, a^m_{n_k})$$
This sequence has a convergent first coordinate. Now apply the same to the second coordinate, i.e. take a convergent subsequence of second coordinate and accordingly take subsequence of whole $(A_{n_k})$. Note that the first coordinate is still convergent but additionaly the second one now is.
Since we have finitely many coordinates, then we can iterate this finitely many times to obtain a subsequence of $(A_n)$ that is convergent. Hence $X$ is compact.
If $X_1,\ldots, X_m$ are compact metric spaces and $X=X_1\times\cdots\times X_m$ then consider a sequence
$$(A_n)=(a^1_n, \ldots, a^m_n)\subseteq X$$
Now pick a convergent subsequence $(a^1_{n_k})$ of $(a^1_n)$ and take a subsequence
$$(A_{n_k})=(a^1_{n_k}, \ldots, a^m_{n_k})$$
This sequence has a convergent first coordinate. Now apply the same to the second coordinate, i.e. take a convergent subsequence of second coordinate and accordingly take subsequence of whole $(A_{n_k})$. Note that the first coordinate is still convergent but additionaly the second one now is.
Since we have finitely many coordinates, then we can iterate this finitely many times to obtain a subsequence of $(A_n)$ that is convergent. Hence $X$ is compact.