Let's take $\varphi(n)=180$ as an example. We'll take a systematic approach, going through each of the possibilities.
First, we write $n=p_1^{e_1}p_2^{e_2}\cdots p_k^{e_k}$, where $p_1,p_2,\cdots,p_k$ are distinct primes and $e_i\ge 1$ for all $1\le i\le k$. Then we know:
$$\varphi(n)=p_1^{e_1-1}(p_1-1)p_2^{e_2-1}(p_2-1)\cdots p_k^{e_k-1}(p_k-1)$$
So what we need to do, is find primes such that $p-1\mid 180$. Or, equivalently (and easier), we need to check for every divisor $d$ of $180$ whether $d+1$ is prime. Only the primes we find then, can be factors of $n$. So let's see: the divisors of $180$ are (using $180=2^2\cdot 3^2\cdot 5$):
$$\{1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 30, 36, 45, 60, 90, 180\}$$
And so we add $1$ to each of these, and check whether or not they are prime. The set we then have left, is (we'll call it $S$):
$$S:=\{2, 3, 5, 7, 11, 13, 19, 31, 37, 61, 181\}$$
Now let's say we have a prime $p\in S$, such that $p^2\mid n$. Then, $p\mid 180$; thus, $p\in\{2,3,5\}$. Those are the only prime that $n$ can have more than once. Now note that $\gcd(a,b)=1$ implies $\varphi(ab)=\varphi(a)\varphi(b)$. Now let's finally find some solutions!
Let $n=181\cdot m$. Then $\varphi(n)=180=180\varphi(m)$; We now have to solve $\varphi(m)=1$. We see two solutions, $m=1$ and $m=2$, resulting in solutions, $\color{red}{n=181}$ and $\color{red}{n=362}$.
Let $n=61\cdot m$. Then $\varphi(n)=180=60\varphi(m)$; We now have to solve $\varphi(m)=3$. We can do this the same method described above (the set of divisors of $3$, $\{1,3\}$, add one, check if prime, get $\{2\}$, and see that $\varphi(2^{e_1})=3$ never happens). No solutions.
Let $n=37\cdot m$. Then $\varphi(n)=180=36\varphi(m)$; We now have to solve $\varphi(m)=5$. No solutions.
Let $n=31\cdot m$. Then $\varphi(n)=180=30\varphi(m)$; We now have to solve $\varphi(m)=6$. We find $m\in\{7,9,14,18\}$, resulting in $\color{red}{n=217}$, $\color{red}{n=279}$, $\color{red}{n=434}$, and $\color{red}{n=558}$.
Let $n=19\cdot m$. Then $\varphi(n)=180=18\varphi(m)$; We now have to solve $\varphi(m)=10$. We find $m\in\{11,22\}$, resulting in $\color{red}{n=209}$ and $\color{red}{n=418}$.
Let $n=13\cdot m$. Then $\varphi(n)=180=12\varphi(m)$; We now have to solve $\varphi(m)=15$. No solutions.
Let $n=11\cdot m$. Then $\varphi(n)=180=10\varphi(m)$; We now have to solve $\varphi(m)=18$. We find $m\in\{19,27,38\}$, resulting in $n=209$, $\color{red}{n=297}$ and $n=418$.
Let $n=7\cdot m$. Then $\varphi(n)=180=6\varphi(m)$; We now have to solve $\varphi(m)=30$. We find $m\in\{31,62\}$, resulting in $\color{red}{n=217}$ and $n=434$.
Now we've arrived at the factors that $n$ can contain
multiple times. Luckily, we've already handled all the other possible prime factors, so that we know $2$, $3$ and $5$ are the only primes dividing $n$. Note however that if $5\not\mid n$, then $5\mid\varphi(n)$ will never happen, since neither $2$, $2-1$, $3$ and $3-1$ contain a factor $5$. Thus, $5\mid n$ (we already knew $n$
could be divisible by $5$, but now we know it
needs to). The same is true for $3$. Thus, there are two cases left; $2\mid n$ or $2\not\mid n$. In the first case, write $n=2^a3^b5^c$ and use the formula to see
$$180=2^23^25=\varphi(2^a3^b5^c)=2^{a-1}(2-1)3^{b-1}(3-1)5^{c-1}(5-1)=2^{a+2}3^{b-1}5^{c-1}$$
but then $a=0$; contradiction, we assumed $a\ge 1$. Now the second case, $2\not\mid n$; We write $n=3^b5^c$ and use the formula to see
$$180=2^23^25=\varphi(3^b5^c)=3^{b-1}(3-1)5^{c-1}(5-1)=2^33^{b-1}5^{c-1}$$
and we see this leads to a contradiction (since the left-hand side is not divisible by $8$ but the right-hand side is).
Therefore, we've checked all the possibilities and have found all solutions ($10$ total).