The Catechism in Questions & Answers

81. What does it mean to be created in the image of God?

Through His Word God created everything and called man by name. Man has thus been addressed (“You may eat...”) and loved by God. He can listen to God’s address and respond to the love of God.
It is because God addresses man, provides for him, and allows him to share in divine characteristics such as love, reason, and immortality, that man is in the image of God.
God is independent, that is, completely free. He has also given man, who has been created in His image, the opportunity to decide freely for himself. At the same time, the freedom with which he has been endowed makes man responsible for his actions (cf. Genesis 2: 16-17).

And the Lord God commanded the man, saying, ‘Of every tree of the garden you may freely eat; but of the tree of the knowledge of good and evil you shall not eat, for in the day that you eat of it you shall surely die’.”
Genesis 2: 16-17