I like to think of the garden of Eden before the fall as a perfect environment. So what was the devil doing there? Can you imagine being in heaven with Jesus and the devil being there also tempting you. Don't think so. Yet God permitted the devil to tempt Adem and Eve in the garden of Eden. A paster told me that the devil is like the best sales person in the world knocking on the door of your house trying to sell sin to you. The devil is way smarter than Adam and Eve, it's like they didn't have a chance. What kind of spiritual warfare training did Adam and Eve have so they would be ready to face the devil in the perfect environment the garden of Eden.
Ezekiel 28:13 You were in Eden, the garden of God; Every precious stone was your covering: The sardius, topaz, and diamond, Beryl, onyx, and jasper, Sapphire, turquoise, and emerald with gold. The workmanship of your timbrels and pipes Was prepared for you on the day you were created.
Satan was in the garden of God as the leader of the heavenly choir of the Most High. Apparently, God prepared good works for Satan, that he should walk in them. (Ephesians 2:10)

Satan was also part of the heavenly council. (Job 1:6)
Ezekiel 28:14-15 "You were the anointed cherub who covers; I established you; You were on the holy mountain of God; You walked back and forth in the midst of fiery stones. You were perfect in your ways from the day you were created, Till iniquity was found in you.
The devil was perfect since the day he was created. (Genesis 2:1)
Ezekiel 28:16 "By the abundance of your trading You became filled with violence within, And you sinned; Therefore I cast you as a profane thing Out of the mountain of God; And I destroyed you, O covering cherub, From the midst of the fiery stones.
Ezekiel 28:17 "Your heart was lifted up because of your beauty; You corrupted your wisdom for the sake of your splendor; I cast you to the ground, I laid you before kings, That they might gaze at you.
The devil has sinned from the beginning. (1 John 3:8) It is revealed he was a murderer from the beginning. (John 8:44) Now Jesus said murder in the heart was in danger of hell fire. (Matthew 5:21-22) Hell was in fact prepared for the devil and his angels. (Matthew 25:41) From the beginning, the obsession of the devil has been to thwart the purpose of God being worked out through the woman. (Genesis 3:15; Revelation 12:4) Pride is the beginning of evil.