Bonds form as atoms wish to obtain the octet rule/a full valence shell.
Well.firstly taking about:
- Ionic Bonding :
In ionic bonding there is formation of bond by exchange of electron.
When NaF is formed they are formed by sharing of electron,Sodium has an extra electron which it donates to Florine and there is the formation of a bond.
- Covalent bonding:
A covalent bond is a chemical bond that involves the sharing of electron pairs between atoms.
A carbon atom has valency 4 so it shares its electrons with 4 hydrogen atoms and completes it's octate.
- Metallic bonding :
It is a kind of bonding in which the valence electrons of metals are invoved in it. As the valence electrons of metals are very loose they can go out of there shell and can roam anywhere in the crystal lattice.
when a metal looses atom it gains apositive chargeand electrons roam in the lattice.