When God created human beings he said
“Let us make man in our image, after our likeness. And let them have dominion over the fish of the sea and over the birds of the heavens and over the livestock and over all the earth and over every creeping thing that creeps on the earth.” (Genesis 1:26)
In saying “Let us”, he appears to be speaking to someone.
It is most likely that he is talking to the angels. We know they were there because God says they shouted for joy at creation (Job 38:7).
Later in Genesis, after Adam and Eve sinned, God says
“Behold, the man has become like one of us in knowing good and evil.” (Genesis 3:22)
Again, God appears to be speaking with his heavenly angels who knew both good and evil.
A similar view of God in conversation with his angels is given by the prophet Micaiah:
And Micaiah said, “Therefore hear the word of the Lord: I saw the Lord sitting on his throne, and all the host of heaven standing beside him on his right hand and on his left; and the Lord said, ‘Who will entice Ahab, that he may go up and fall at Ramoth-gilead?’ And one said one thing, and another said another.” (1 Kings 22:19-20)