Genesis 2:17 says that God told Adam, “But from the tree of the knowledge of good and evil you shall not eat, for in the day that you eat from it you will surely die.” However, Adam lived long after he and Eve ate of the forbidden fruit. They had Cain and Abel after they were kicked out of the garden. Genesis 5:4 says that they had other children too. Genesis 5:5 say that Adam lived 930 years. If God said they would die on the day they ate the forbidden fruit, why did they live for so long after they ate it?
The Bible speaks of death in different ways. We read of people dying physically, in which their spirit is separated from their body (James 2:26). That’s probably what you and the average reader of Genesis 2:17 think about when you read that verse, and that’s understandable.
However, the Bible also speaks of death in a spiritual sense. Paul told Christians that before we were in Christ, we were “dead in the trespasses and sins in which (we) once walked” (Eph. 2:1-2, 5). In like manner, he spoke of dying when he sinned (Rom. 7:9-11); he obviously didn’t mean that he had died physically because he was still alive to write the letter to the church in Rome. The reason he correlates being in sin with death is because sin separates us from God (Is. 59:1-2). Death, whether in a physical sense or spiritual sense, is all about separation. We die physically because our soul separates from our physical body. We die spiritually when we sin because our sin separates us from God, and without forgiveness and reconcilation we will be separated from God eternally in hell, which is called the “second death” (Rev. 21:8).
Adam and Eve sinned by disobeying God when they ate of the forbidden fruit (cf. 1 John 3:4), and thus immediately “died” in a spiritual sense in that their sin separated them from God. Scripture hints that they repented and served God faithfully afterwards in that they acknowledged God’s help when their children were born (Gen. 4:1, 25) and they clearly had taught their children to have faith in God and obey God, even if Cain did not (Gen. 4:3-4; cf. Heb. 11:4; Rom. 10:17). So it is reasonable to conclude that they were forgiven by God and likely will not find themselves eternally separated from him in hell.