Edit: I'll try to make this proof work for OP, who hadn't learned Galois theory yet. This may be over their head at the moment, but soon enough OP will encounter the content of this answer anyway. Hopefully, this will be helpful sneak peek into Galois theory.
Preliminaries:
For convenience, let the characteristic be $0$, which ensures that minimal polynomial doesn't have multiple roots in algebraic closure.
Proposition 1. Let $K$ be finite extension of $k$ . Then $[K:k]$ is equal to the number of $k$-linear embeddings of $K$ into algebraic closure $\overline K$.
Sketch of proof. Basically, you can do induction on the number of generators. Assume, thus, that $K = k(\alpha)$ and $f$ its minimal polynomial. Then any embedding $\sigma\colon K\to\overline K$ is uniquely determined by sending $\alpha$ to its conjugate, and these are all the embeddings. Verify this by noting that $k(\alpha)\cong k[x]/(f)$. Thus, both the number of $k$-linear embeddings and the degree of $K/k$ is equal to $\deg f$, which finishes the base of induction. I will let you reflect on the step of induction yourself, hint being $[K:k]=[K:E][E:k]$. $\tag*{$\square$}$
Proposition 2. Let $K$ be algebraic extension of $k$. It is equivalent:
$1)$ If $\alpha\in K$, then all of its conjugates over $k$ are in $K$.
$2)$ Every $k$-linear embedding of $K$ into its algebraic closure if automorphism of $K$.
Proof. Assume $1)$. If $\sigma\colon K\to \overline K$ is $k$-linear embedding, it sends any $\alpha\in K$ to its conjugate, but by $(1)$, it follows that $\sigma(\alpha)\in K$, i.e. $\sigma(K)\subseteq K$. We still have to prove surjectivity. Let $\alpha\in K$ and $f$ its minimal polynomial over $k$. Let $E$ be extension of $k$ generated by roots of $f$. We have inclusions $k\subseteq E\subseteq K$, by $(1)$. Restrict $\sigma$ on $E$, which is finite dimensional over $k$. Notice that $\sigma$ permutes roots of $f$, and thus $\sigma(E)\subseteq E$. By finite dimensionality, $\sigma$ is automorphism of $E$, which means that there is $\beta\in E$ such that $\sigma(\beta) = \alpha$. This proves surjectivity.
Now assume $(2)$. Take $\alpha\in K$ and take one of its conjugate $\beta$. Then $\sigma\colon \alpha\mapsto\beta$ defines $k$-linear embedding of $k(\alpha)$ into $\overline K$. Since $K$ is algebraic extension, we can extend $\sigma$ to embedding of $K$ into $\overline K$ (if $K$ were finite, then you could just use induction to prove the existence of extension, and in infinite case the existence of such extension is guaranteed by Zorn's lemma). By $(2)$, $\sigma$ is then automorphism of $K$, and hence $\beta\in K$. $\tag*{$\square$}$
Extension $K$ of $k$ that satisfies the above conditions is called normal extension.
Corollary. If $K$ is finite normal extension of $k$, then $[K:k]$ is equal to the number of $k$-linear automorphisms of $K$.
Denote the group of $k$-linear automorhpisms of finite normal extension $K$ of $k$ by $\operatorname{Gal}(K/k)$.
Solution to the problem:
Let $\zeta = e^{2\pi i/n}$. Then $\Bbb Q(\zeta)$ is obviously normal extension since it contains all the powers of $\zeta$ and consequently, all the roots of the minimal polyomial of $\zeta$ over $\Bbb Q$. So, $[\Bbb Q(\zeta):\Bbb Q] = |\operatorname{Gal}(\Bbb Q(\zeta)/\Bbb Q)\,|$ by the above Corollary.
Now, take $f\in \operatorname{Gal}(\Bbb Q(\zeta)/\Bbb Q)$ and let $g\in\operatorname{Gal}(\Bbb Q(\zeta)/\Bbb Q)$ be its inverse. They are uniquely determined by their action on $\zeta$ and they must send $\zeta$ to its conjugate. Let $k,m\in\Bbb Z$ such that $$f(\zeta)=\zeta^k,\ g(\zeta) = \zeta^m.$$ Compose $f$ and $g$ to get that $\zeta^{mk} = \zeta$ which happens if and only if $mk\equiv 1\pmod n$. But, that means $k$ is invertible in $\Bbb Z/n\Bbb Z$, which is equivalent to $k$ being relatively prime to $n$.
Conversely, it is just as easy to see that if $k$ is relatively prime to $n$, $f:\zeta\mapsto \zeta^k$ is invertible, inverse given by map $\zeta\mapsto\zeta^m$, where $mk\equiv 1\pmod n$.
Thus, $|\operatorname{Gal}(\Bbb Q(\zeta)/\Bbb Q)\,|=\varphi(n)$. The claim follows.