For a simple example to demonstrate the importance of the basis being orthonormal, consider $\mathbb{R}^2$ with the standard inner product and the basis $h_1=(1,0)$ and $h_2=(1,1)$. If $h=(0,1)$ then $$ h=-h_1+h_2 $$ but $\langle h,h_1\rangle=0$.
By the way, a Hilbert space basis of $H$ is different from a basis of $H$ as an abstract vector space (called a Hamel basis). The latter is generally much larger, as only finite linear combinations of the elements are permitted.