Water is a highly ordered material. When something dissolves in water, some of these O-H bonds are broken. This requires heat energy. The water molecules can then form attractive interactions to solute ions or molecules, releasing heat energy.
A crystal of NaCl is also highly ordered. The chloride anions form a cubic close packed lattice and the sodium cations fit into the octahedral holes in the lattice. Strong ionic bonding holds the anions and cations together in the crystal. When NaCl dissolves in water the strong ionic bonds are broken (requiring heat energy) and the ions interact with water molecules (releasing heat energy). This increases the entropy (chaos) of the solution leading to less energy being required to freeze the solution