Newton's laws states that for every action there is an equal and opposite reaction. That is why we do not sink in ground because we apply a force of mg on the ground and the ground responds with a reaction force whose magnitude is equal to mg but is opposite in direction. This makes us able to stand on ground but when we stand on sand then we sink in it beacuse instead of applying a reaction force equal to mg, the sand moves away. So my question is that if the sand does not apply a reaction force then does it violates Newton's third law.
You apply a downward force on the sand and the sand exerts an equal and opposite force on you - Newton’s third law.
The net force on you is your weight due to the gravitational attraction of the Earth and the upward force due to the sand which is less than your weight.
So you accelerate downwards and now you again have the sand/you action and reaction forces but let’s say they are of greater magnitude than before so you downward acceleration is less.
Your downward movement continues until the magnitude of the sand/you action and reaction force is equal in magnitude to your weight.
As there is now not force on you you will stop accelerating downwards.
At all times Newton’s third law is obeyed.
You do sink into sand a little ways because, as you said, the sand is able to move out of the way. But, this is only true for the top layer of sand. Lower layers of sand are surrounded on all sides by other grains of sand and have nowhere to go. The friction between grains of sand is enough to lock them in place. This is different than, say, water because the molecules of water have a much weaker bond to each other than the frictional forces in sand. This means that water below the surface can move out of the way freely, allowing you to sink.
If you take away the frictional force in sand, you can sink into it like this: