"In Islam, the notion that God can die is impossible. Allah is the Ever-Living, the Eternal—He exists beyond time, change, or decay. The Qur'an states, 'He is the First and the Last, the Ascendant and the Intimate, and He is, of all things, Knowing' (Surah Al-Hadid, 57:3), and 'Everything will perish except His Face' (Surah Al-Qasas, 28:88). Death is a trait of created beings, not the Creator. If God could die, He wouldn't be God—He'd be limited, temporary, and dependent, which contradicts His absolute nature as defined by Tawhid.
In the Trinity, the claim that Jesus (peace be upon him), as God, died on the cross raises a problem: how can an eternal, all-powerful God cease to exist, even momentarily? It suggests weakness or division in God's essence, which doesn't align with true divinity. In Islam, Allah is unchanging and immortal—He sustains all life and never falters. Tawhid upholds this: Allah is One, beyond death or any human limitation, ensuring His perfection and reliability as the only One worthy of worship."
Surah Al-Furqan, 25:58
We have different definitions of death and its consequences. Do you think that when you die you cease to exist? That death is the end? Of course not, you believe when you die that you will go before God for judgement and get either your reward or your punishment for eternity. Why then do you treat death as if it is an end?
Death is just changing forms or locations. Losing one aspect of us but our spirits and souls do not cease to exist for even a moment. Why then, if Jesus died, would you think that God ceased to exist for any moment of time? Jesus is eternal and continued to exist before, during, and after his death.
Death can be better defined as a separation from some aspect of us. For trinitarian beings like humans we have our bodies separated from our souls and spirits. Our bodies stay on Earth and rot and decay but our spirits go to their next location of waiting. We still exist at this stage before the resurrection but we are in a different form. Death, therefore, is the breaking of the unity of our beings.
For God, who is a greater Trinity than us, his death would be separation of the Father and the Holy Spirit from the Son. So, when Jesus was on the cross God had died as his unity was broken. In the same way that our bodies are taken from us, the Son was taken from Yahweh. This and Jesus also experienced human death with his own human nature split and broken for a time. After Jesus's resurrection his human nature was restored and God's unity was restored.
So, yes. God can die. Just not in the way that he "ceased to exist" as that doesn't happen for any of us.