The Catechism in Questions & Answers

304. How are we to understand the prohibition of producing and worshipping images?

Exodus 20: 4-5 forbids creating images of that which God has created: “You shall not make for yourself a carved image— any likeness of anything that is in heaven above, or that is in the earth beneath, or that is in the water under the earth; you shall not bow down to them nor serve them.”
The prohibition of creating and worshipping images must be seen in the context that there were images and statues that were venerated and worshipped as deities at the time.