Death came into the world for one reason: because of sin. So in one way you are right: God can’t die or go out of existence, because He can never sin. As the Bible says, “From everlasting to everlasting you are God” (Psalm 90:2).
But from another point of view, some part of God actually seemed to die when Jesus Christ was put to death on the cross. The reason is because Jesus wasn’t just another human being; He was also God in human flesh. In other words, Jesus was both fully God and fully man: “For in Christ all the fullness of the Deity lives in bodily form” (Colossians 2:9). This is a profound mystery we will never completely understand until we get to heaven—but when Jesus died on the cross for us, God Himself was bearing the punishment we deserve for our sins.
The real question, however, is this: Why did Jesus endure the cross? Why was the Son of God willing to endure the wrath of His Father? The reason is because God loves us, and this was the only way He could free us from sin’s penalty and open heaven’s door for us. “For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life” (John 3:16). Is your faith and trust in Him?
Do you want to know how much God loves you? Look at Jesus, who left heaven’s glory and died on the cross for you. But He did not stay in the grave, and today He is in heaven, “able to save completely those who come to God through him” (Hebrews 7:25).