So if we actually write the relation you wrote as a sum of basis matrix elements we get $$a = \sum_k ~\sqrt{k} ~~|k-1\rangle\langle k|~.$$From this you rediscover your relation, for example, by operating on the state $|n\rangle$ to create a Kronecker delta:$$a|n\rangle = \sum_k ~ \sqrt{k} ~~|k-1\rangle\langle k|n\rangle = \sum_k ~ \delta_{kn}~\sqrt{k} |k-1\rangle = \sqrt{n}~|n-1\rangle.$$ Recall that $\delta_{ab}$ is 0 if $a \ne b$ or else 1 when $a = b.$
Practices: show that its conjugate $a^\dagger$ has $|k\rangle\langle k-1|$ in the sum in place of $|k - 1\rangle\langle k|,$ and then use the fact that $\langle \ell - 1|k - 1\rangle = \delta_{(\ell-1)(k-1)} = \delta_{\ell k}$ to prove that $a^\dagger a = \sum_k k~|k\rangle\langle k|,$ the number operator $\hat n$. Then prove similarly that $a a^\dagger = \hat n + 1$ and therefore that $[a, a^\dagger] = 1.$
If you can successfully complete those practice exercises you should also be able to follow the following calculation: $$\langle n|a = \sum_k \sqrt{k} \langle n|k-1\rangle\langle k| = \sum_k \delta_{n(k-1)} \sqrt{k}\langle k|=\sum_k \delta_{(n+1)k} \sqrt{k}\langle k|=\sqrt{n+1}~\langle n+1|.$$