We have no other shelter. We can't walk through the day, that's murder, so what do you suggest?
If you're Stranded in the desert in the first place you're usually forgeted anyway. Also the Sahara desert and all dune deserts have shifting sanding with wind so hiding under a layer of sand most likely end up waking up under 5 feet of sand. During the day you position yourself in the shadows of a dune hill and rest, night time can be freezing you start walking during Dust to Dawn, best to keep moving during the night as it'll produce heat for your body.
Best idea you can do is head in the direction you first came before getting stranded or otherwise head to the nearest shore line depending on where you last were. Once and if you hit the beach you can follow it till civilisation. Considering the amounts of food you have and the amount of water you best beat in the end is to Self Delete near death to stop further suffering. A gun is useless if there's nothing to kill.