What is the difference between covalent and ionic bonding?
covalent bond is a chemical bond that involves sharing of electron pairs between atoms.
In covalent bonding electrons are shared between two atoms. So those electrons belong to both of those atoms. If you look at an actual image of say the covalent bond between two Hydrogen atoms, you can see that the electron cloud surrounding these two atoms sort of merge between them. This means that both the atoms are exerting an attractive force on the electrons being shared. Thus this is a covalent bond.
Don't get too confused with the Lewis dot structures that show a straight line joining two H atoms. It's just simpler to write it that way as one cannot actually show the bonding on a piece of paper.
In ionic bonding, electrons are donated by one atom and another atom receives them. Ex: Na gives 1 electron to Cl to form the ionic compound NaCl.
Both ionic and covalent bonding arise out of the need for electrons or the need to remove electrons in order to have a complete octet, which is stable.
So while solving problems just look at the electronic configurations of the participating atoms and try to figure out which atom receives and which atom gives electrons.
Note that you will automatically realise the significance of covalent bonding when you do that as when neither can give nor receive, they will share!