When you die in No Man’s Sky, you’ll lose the items that you had on you. However, you will be given a chance to get them back if you go back to the spot where you died and retrieve them. If you die again before getting to that spot, you’ll lose those items permanently.
If you happen to be in a very hostile star system, there’s something you can do to avoid the enemy ships and get your items back in a much safer fashion. The cool thing to note is that your grave spot – the spot where you go to retrieve your lost items – will actually follow you around even if you jump to another star system. So say you were shot down in space, and you don’t want to risk encountering the space pirates again, you can simply warp to another system if you have the resources for it, and look for your grave spot there instead.
Of course, there’s always the risk of you getting attacked in the next system anyways, but it’s still a handy trick to keep in mind if you just want to get out in a hurry. Try to keep some of your valuables in your Exosuit inventory as well to avoid losing everything in one fell swoop.