What makes hard materials hard and soft materials soft?

Something is hard if, when the atoms are pushed, they don’t get out of the way.

An example of a hard material would be diamond.
When you push the surface atoms in a diamond crystal, the atoms try to move. But the electrical energy increases very quickly as the atoms are displaced and so it takes lots of energy to move the atoms even a tiny distance. So pushing hard doesn’t change the shape.

An example of a soft material would be rubber.
In rubber, atoms are arranged in long strings that are tangled together. However, the strings can slide past each other so when you press the surface of rubber, the electrical interactions cause the atoms to change shape.