The most important thing is to remain calm and think clearly. If you start panicking, you can lose control and end up losing your chance of survival. You're not going to do so well if you've driven yourself mad. Read William Golding's novel 'Pincher Martin' for a great account of how you can convince yourself of almost anything if you don't take control of deserted rock because he lets panic get the better of him. Also to calm down you can find something to make a buddy out of. If you make a buddy to talk to it will help you calm down. Your priorities should be Safety, Water, Shelter, Food. In that order.