What does Exodus 20:4-5 mean?

4 Thou shalt not make unto thee any graven image, or any likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth: 5 Thou shalt not bow down thyself to them, nor serve them: for I the LORD thy God am a jealous God, visiting the iniquity of the fathers upon the children unto the third and fourth generation of them that hate me; (Exodus 20:4-5 KJV)

British Family Bible

Thou shalt not make unto thee &c. In this second Commandment, which concerns the worship of God, are forbidden these sins; 1. The appointing of any kind of image for religious worship. Le 26:1. 2. The worshipping of such an image or any other creature. Re 22:8,9. 3. The neglect of the worship of the true God. Ro 1:25. 4. The worshipping of Him after a false manner. Mt 15:8,9. Because the Lord is a jealous God, Isa 42:8, and a severe punisher of idolaters. De 8:19. In the same Commandment are enjoined these duties: 1. That God only be religiously worshipped. Mt 4:10. 2. That He be worshipped both in body and spirit. Ps 95:6; Joh 4:23. And to such worshippers, who thus love and obey the Lord, He hath promised His especial mercy. Joh 9:31. Oxford Catechism.

— graven image, or any likeness The Hebrew word, translated “graven image,” properly signifies a statue made of wood or stone; that translated “likeness,” means a picture drawn on a wall or flat surface. Bp. Patrick.

This Commandment seems to have been framed with a view to the worship of Egypt. To any people, who had not been conversant in that country, it had been sufficient to say, “Thou shalt make no graven image, nor frame any similitude of things.” But the commandment is dilated, and the nature of the objects pointed out, for the sake of the Israelites. They were not to make to themselves and “image or likeness of any thing that is in heaven above, or that is in the earth beneath, or that is in the water under the earth;” nor were they to “bow down to, or worship them,” either real or represented. By this is intimated, that they were not to make a likeness of the sun, or of the moon; of man, or of beast; or fly, or creeping thing; of fish, or of crocodile, “which are in the waters beneath.” How prone the Israelites were to this symbolical worship, and how necessary it was to give them warning, may be seen by the threat, and by the blessings which immediately follow. Bryant. See the note on De 4:18.

—  a jealous God, Jealous of the honor due to Him alone, not bearing any rival or partner in what belongs to Him alone. Dr. Wells. I am a jealous God: I am so affected to you my people, as a loving husband to his wife, whom he cannot endure to set her affections of another. Bp. Hall. Not jealous for Himself, lest He should suffer for the follies of His creatures; that cannot be: but jealous for “his spouse, the church;” lest our notions of His nature and attributes, and consequently of the duties which we owe to Him, being depraved, and our minds darkened with superstitious persuasions and fears and hopes, we should depart from the fidelity, which we have vowed to Him; and fall into those grievous immoralities, which St. Paul describes as the consequences of idolatry, Ro 1:21-32, and which have been its consequences in all times and places. Abp. Secker.

— visiting the iniquity of the fathers upon the children It cannot consist with the justice of God, to punish one person for the sin of another; neither does God threaten any such thing. But God, who is the great Lord of the whole world, may so punish a man for his sins, that the temporal evil of it may reach, not to himself alone, but to his posterity also. As in the case of high treason, the father, by forfeiting his honor and estate, brings the ill consequence of his crime upon his family, as well as upon himself; and the prince, by enacting the penalty of the law, may justly be said to visit the children, for the offence which the father committed. The meaning of this part of the commandment is this: God had, in general, promised to the Jews temporal blessings, to encourage their obedience; and had denounced present evils against them, to keep them from sinning. But to set a particular mark of His indignation on the sin of idolatry, He thought fit to declare, that if they offended in this matter, He would not only severely punish them Himself, but would deliver them up into the hands of their enemies, who should oppress both them and their children after them; whereas if they continued firm to His worship, though otherwise they should be guilty of many lesser crimes, yet He would not cast them off from His favor, but on the contrary would bless both them and their posterity with plenty and prosperity all their days. This I take to have been the literal meaning of the present denunciation; and how exactly it was made good to them, their history sufficiently declares to us. 1Ki 11:31-35; 14:22,23,25; 15:29,30; 2Ki 22:17; 24:3. Compare Ex 21:3; La 5:7. Abp. Wake.