The hydrogen is positively charged so for the formation of the molecule it will bond to the atom which is negatively charged. The hydrogen bond formed is weaker than the covalent or ionic bond while stronger than Vander Waals forces.
For example- In water , The two hydrogen with a positive charge is connected to oxygen which is partially negative in nature.
Hence, the formation of hydrogen bonding takes place.