What evidence do we have that convinces us that sodium chloride is an ionic compound?
The two most important ones are (a) it does not conduct electricity in solid form, but does in liquid form and solution and (b) it is brittle and shatters when hit, not malleable or ductile.
Why do these two things convince us that sodium chloride is an ionic substance?
First, conduction. If it were a molecular covalent substance, like glucose, it would not conduct in any phase: the molecules are whole and electrically neutral. If it were metallic, it would conduct in solid state because of the sea of delocalised valence electrons.
But an ionic substance is made up of positive and negative ions. In the solid state they are locked into a crystal lattice and unable to move past one another, so they cannot conduct electricity. When they dissolve in water, though, or are melted into the liquid state, the ions can move and carry current.
When we hit a piece of metal with a hammer it will dent, or we can hammer it out flat (malleable) or draw it out into a wire (ductile). If we try this with a sodium chloride crystal, it will shatter instead.
This is because, in solid sodium chloride, each positively charged sodium ion is surrounded by negatively charged chloride ions, and vice versa. If we hit the crystal with a hammer, suddenly sodium ions are close to sodium ions and chloride ions are close to other chloride ions, and they repel instead of attract, shattering the crystal.
Both these pieces of evidence support the view that sodium chloride is an ionic substance.