Example: When you rub your hands together, the action of scraping the surface of your skin back and forth against each other causes the molecules in your skin to move a little faster. The faster that molecules move, the higher the temperature. So the friction of rubbing your hands together makes them feel warmer.
So when you shake the sand the molecules move faster make the temperature warmer.