A chemical bond between two combining atoms can be formed by
sharing of electrons
A chemical bond between two combining atoms can be formed by either electron transfer or electron sharing. During an electron transfer, the combining atoms transfer their valence electrons to each other in order to attain stability. This kind of chemical bonding is known as ionic bonding. The diagram given below is showing the ionic bonding between sodium and chlorine atoms to form NaCl.
During electron sharing, the combining atoms share the pairs of electrons to each other in order to attain stability. This kind of chemical bonding is known as covalent bonding. The diagram given below is showing the covalent bonding between two oxygen atoms to form O2 molecule.