In an emergency, stay where you are if rescue is likely to come. If not, shelter, water, food are your priorities. But my best advice is to be thoroughly prepared in the first place.
A few practical tips that I've found useful:
If you are in any way vulnerable to the elements, carry a SURVIVAL KIT: something that's very small and light, and that you won't feel tempted to leave behind at camp. Contents I include vary enormously, depending on if I'm in hot desert, when it might include distress flares, and a mirror for signalling from the sun, to cold desert (when it would have a mini stove, for melting snow for water) to "jungle" (when it might include extra antibiotics, fishing line and fishing hooks). But there's always a compass, sometimes a GPS (although I tend not to navigate with one normally) and some sort of map, and waterproof matches, water purification tablets and some basic antibiotics, a high energy food item (nuts, pork scratching, a chocolate bar even), and a pencil and paper for leaving messages.
In addition, I always carry crepe bandages – in case I sprain an ankle, as I've been prone to do in rain forest. Remember that your feet/legs are your most important asset – more important than hands even. Break a leg and you can't go anywhere.
- Keep yourself covered - always long sleeves and trousers, to stop evaporation. Use a hat, shades, and stick of sun block for your nose.
- Put white tape on your penknife - or a colour that will show up if you drop it in sand. Red doesn't normally show.
- Carry a water bottle with you at all times; and a whistle - can be heard for miles if you are lost, hopefully. Torch and/or flares for attracting attention at night.
- Remember it's a cold desert. Above all, you will need a stove to melt ice in order to drink. I always carried a spare mini stove in an enlarged survival kit - and a survival blanket and flapjack etc for calories. Water may be obtained from the snow and ice, but ingesting it in large amounts can dangerously lower your core temperature.
- Keep yourself clean - fungi will otherwise tend to grow on your skin, and start rotting it, especially groin and between toes.
- Carry salt - just sprinkle it on leeches, and they'll come off.
- Carry a mosquito net which is impregnated with anti-mosquito repellent. Keeps them from biting through.
- Stick to rivers if you want food – it's what indigenous people do. Piranhas and snakes are only VERY rarely a danger – I've never been attacked by either, and there are few people who've spend so longer alone in Rain Forest. Piranhas make an easy source of food in the Amazon, but you'll need wire to connect your hook (baited with insects/grubs etc) to the line – to prevent their teeth biting through.