Hydrogen bonds occur when partial opposite charges on molecules come close enough to attract each other.
This type of bond typically occurs between a hydrogen atom, which is covalently bonded to a more electronegative atom (like oxygen or nitrogen), and another electronegative atom. The partial positive charge on the hydrogen atom and the partial negative charge on the other electronegative atom create an attractive interaction known as a hydrogen bond.