# Why can a hydrogen atom become either an ion or a part of a molecule?

If it shares, e.g. with another $H$, they both 'seem' to have 2 electrons, just like helium, a noble gas. That's a more stable situation. Or two of them can share with oxygen, so the oxygen atom 'looks' like neon, another noble gas, and the H's again 'look' like helium. That's how water ${H}_{2} O$ is formed.
It may also donate its electron. It then becomes a naked proton, that can attach to e.g. water, to form the acid hydronium ion ${H}_{3} {O}^{+}$