Read John 3:16
For God loved the world in this way: He gave His One and Only Son, so that everyone who believes in Him will not perish but have eternal life. - John 3:16
Even though God created humans perfectly, He gave them the ability to choose.
Adam and Eve chose their own selfish desire over God’s plan for their lives,
which caused them to perish (die).
Death was a result of their disobedience (sin).
This death wasn’t just an eventual physical death, but also a lack of a relationship with God.