An ionic compound is a giant structure of ions. The ions are held together by strong electrostatic forces of attraction between oppositely charged ions. These forces act in all directions throughout the structure, which is called a lattice. This is what we mean by ionic bonding. Sodium chloride is the example you must know, with sodium ions and chloride ions alternating in a regular pattern.
The structure can be shown as a dot and cross diagram, a ball and stick diagram, or a two-dimensional or three-dimensional diagram, and each has limitations. A dot and cross diagram shows the electron transfer but not the giant lattice. A ball and stick diagram shows the arrangement, but its sticks suggest bonds in particular directions and it shows only a few ions. A two-dimensional diagram cannot show the full three-dimensional arrangement. A three-dimensional diagram is better, but it is hard to see the ions inside and it still shows only a small part of the whole structure.
You can work out the empirical formula of an ionic compound from a model by counting the ions and writing the simplest whole number ratio. Sodium chloride has equal numbers of the two ions, so its formula is NaCl. If a model shows 6 magnesium ions and 12 chloride ions, the ratio is 1 to 2, so the empirical formula is MgCl2.