What is different between an ionic bond and a covalent bond?
Ionic bonds are bonds between two elements who has a large difference in electronegativity. For instance Sodium chloride:
Sodium have a low electronegativity and chloride have a very high electronegativity.
Covalent bonds are bonds between elements both with high electronegativity. For instance CO2. Oxygen have a high electronegativity and carbon have a electronegativity in approx the middle of the scale.
As a rule of thumb you can think of it as, the non metal elements forming molecules, for instance
All metals (for the most) bonding with a non metal forms an ionic bond: