[guided]The Möbius function vanishes exactly on integers divisible by the square of a prime. Therefore, in the divisor sum
\begin{align*}
\sum_{d \mid n}\mu(d),
\end{align*}
we only need to keep track of the squarefree divisors of $n$.
Let $p_1,\dots,p_r$ be the distinct prime divisors of $n$. Since $n \geq 2$, at least one prime divides $n$, so $r \geq 1$. For each subset $A \subset \{1,\dots,r\}$, define
\begin{align*}
d_A = \prod_{i \in A} p_i,
\end{align*}
where the empty product is $d_{\varnothing}=1$. This construction gives a squarefree divisor of $n$: each prime $p_i$ with $i \in A$ appears once, and no other prime appears.
Now let $d \mid n$ satisfy $\mu(d)\neq 0$. By the definition of the Möbius function, $d$ is squarefree. Because $d$ divides $n$, every prime divisor of $d$ must be among $p_1,\dots,p_r$. Since $d$ is squarefree, it is exactly the product of the distinct primes among $p_1,\dots,p_r$ that divide it. Thus there is a unique subset $A \subset \{1,\dots,r\}$ such that $d=d_A$.
For such a divisor $d_A$, the Möbius function counts the parity of the number of prime factors:
\begin{align*}
\mu(d_A)=(-1)^{|A|}.
\end{align*}
All other divisors have Möbius value $0$. Hence the whole divisor sum reduces to the finite subset sum
\begin{align*}
\sum_{d \mid n}\mu(d)
= \sum_{A \subset \{1,\dots,r\}}(-1)^{|A|}.
\end{align*}[/guided]