When Arjuna is reluctant to go to battle, because some of the princes on the enemy side are his relations, Shri Krishna explains to him that the Self cannot be slain:
I have always existed, you too have always existed, and those princes have always existed. The time shall never come when we shall all cease to exist. Just as the Self within the body goes through childhood, manhood and old age, so also it passes to other bodies; a wise man is not puzzled by this.
What is not there cannot exist; what is there cannot be anything but existent. The distinction between these states has been recognized by those who study truth. That which pervades this universe is imperishable; no one can destroy that changeless being. It is these bodies that house the everlasting, imperishable, incomprehensible self that have an end. Therefore fight.
He who thinks the Self can be a slayer, and he who thinks the Self is slain, are both mistaken. The Self does not kill, nor is it killed. For the Self is never born and never dies, nor may it ever become non-existent. This unborn, everlasting, abiding Self is not slain when the body is slain. Knowing the Self to be unborn, imperishable, everlasting, changeless, Arjuna, how can a man slay anyone or be slain?
As a man gets rid of worn out clothes and put on new ones, so the Self puts away outworn bodies and puts on others that are new. Weapons do not cut the Self, fire does not burn it, waters do not wet it, the wind does not dry it. Not capable of being cut, burned, wetted, or dried, the Self is everlasting, present in all things, unchangeable, unmoveable, for ever the same.
Knowing that the soul is immaterial and unalterable, you should not grieve, Arjuna.