Let $G$ be a group of order $12$. Show that if $Z(G)$ is non-trivial, then $G$ has a subgroup of order $6$.
By Cauchy's theorem, there are $a,b$ elements of $G$ of order $2,3$ and by action of conjugation, I know that $|G|=|Z(G)|+ \sum_{i=1}^{n}[G:C_{G}(g_i)]$, where $[g_i]$, $i=1,\dots,n$ are conjugacy classes with more than one element, but I can't find a way to show that there is a subgroup of order $6$.
Any suggestions?