The verse 23 of chapter 2 of Bhagavad Gita says, “Weapons cannot cut the Self, nor can fire burn it. Water cannot wet it, nor can the wind dry it.”
What is this Self? Self is neither the body nor the mind but the knower of the both. It is the pure witness. So whatever that happens doesn’t happen to the Self.
This topic has been already covered by me in many of my previous posts. To get a clear idea, go through the following posts:
Ramana Maharshi and the Cinema Screen Analogy
Sat-Chit-Ananda (Truth, Consciousness & Bliss) : Advaita Vedanta in 3 Infographics
Kshetra Kshetrajna Vibhaga Yoga (Bhagavad Gita: 13.2) – With Animated Yin Yang Images
Here is an animated video that explains this sloka: