The trick is behind transforming the number $4$.
Basically, the original equation can be rewritten as follows:
$$
n = 4^x \\
n = (2^2)^x
$$
Using the properties of exponents, we can rewrite $(2^2)^x$ as $(2^x)^2$. Then, taking the square root of both sides, we get:
$$
n = (2^x)^2 \\
\sqrt{n} = 2^x
$$
Another way to think about it is: that in the second step of your original process, $n$ is equal to $2^x \cdot 2^x$. Anything multiplied by itself is that thing squared, so $2^x \cdot 2^x = (2^x)^2$. Now, we can take the square root again:
$$
n = (2^x)^2 \\
\sqrt{n} = 2^x
$$