To separate two substances from a mixture comprising the two any difference in their characteristics can be used. This could be a difference in their physical properties like size, density, temperature at which a change in state occurs or other more complex chemical properties.
In the case of a mixture of sand and water filtration can used to separate the two. This requires a sieve that does not allow any of the particles of sand to pass through. If the mixture is placed on the sieve, all the particles of sand are blocked and only the molecules of water pass through as they are much smaller in size.
Another way in which the mixture could be separated is by using the difference in temperature at which sand changes state and the temperature at which water is changed from liquid to gas. By heating the mixture to a temperature above 100 C the water is converted to water vapor. This can be collected and condensed back to liquid water.