Compounds are groups of two or more elements that are bond together. There are two main types of bonds that hold those atoms together, covalent and electrovalent/ionic bonds.
Covalent bond – The bond in which one or more pairs of electrons are shared by two atoms.
Ionic bond – The bond in which one or more electrons from one atom are removed and donated to another atom, resulting in positive and negative ions which attract each other.