Throughout, let us assume we are working with a finite group $G$. The order of an element $g\in G$ is denoted by $\left|g\right|$.
It is a standard exercise to prove that if $x, y\in G$ have relatively prime orders (i.e. $\gcd(\left|x\right|, \left|y\right|)=1$) and $xy=yx$, then $\left|xy\right| = \left|x\right|\cdot \left|y\right|$.
What about the converse? If $g\in G$ has order $\left|g\right|=m\cdot n$, where $\gcd(m, n)=1$, do there always exist elements $x, y\in G$ such that $g=xy$, $xy=yx$, and $\left|x\right|=m$, $\left|y\right|=n$ ?
Yes, $g^{am}$ and $g^{bn}$. Where $am+bn=1$ (by Bezout's lemma if you wish).