How can we visualize that $2^n$ gives the number of ways binary digits of length n? Like if we have to find the number of ways can be represented in bits up to 4 places. We use $2^4$, but why do we use this method?

To visualize the method, I would use a binary tree : for each digit you have two choices $0$ and $1$ or left and right in the tree. At the end you have $2^n$ possible ways to get to the last line of the tree.

