I'm going to answer the how and not the why. The potential is $V(r)=-Z/r$. The force is $F=Z/r^2$. This has to match the centripetal force $mv^2/r$. So $v=\sqrt\frac{Z}{mr}$. The momentum is $p=mv=\sqrt\frac{mZ}{r}$. This has, so far, been classical.
Quantum mechanical duality tells us that a particle of momentum $p$ is a wave of wavelength $\lambda=2\pi\hbar/p$ (the De-Broglie relation). But the wave has to "fit" into the circular orbit which has length $2\pi r$. So the wavelength has to be quantized: $\lambda_n=2\pi r/n$ (with $n=1,...,\infty$).
Using the expression for $p$ we obtained earlier, we then have $\lambda_n=2\pi r_n/n=2\pi\hbar/p_n=2\pi\hbar\sqrt\frac{r_n}{mZ}$ which gives $r_n=\frac{\hbar^2n^2}{mZ}$. Substituting this radius into the potential, $V(r)$, we get $E_n=-\frac{mZ^2}{\hbar^2n^2}$. The actual result is $E_n=-\frac{mZ^2}{2\hbar^2n^2}$ so we're off by a factor of 2.