All of this pertains to the hypocrites, for the peril they pose is grave and their deeds are vile. After mentioning these three categories He said, “O people,” thus addressing every group—believers, disbelievers, and hypocrites alike. The scholars point out that the very first call in the Qur’an is this one: “O people, worship your Lord” ⦗al-Baqarah: 21⦘.
“Worship” is an imperative, meaning: devote every act of devotion sincerely to Him. Why? Because He is your Lord, and worship is fitting for none but the Lord, glorified and exalted is He. He then furnished the proof for this with His words: “the One who created you.”
“And those before you” refers to all the nations that preceded you; Allah created the angels, the jinn, humankind, and every creature.
“So that you may become God-fearing”: if you ponder this fact—that it is He who created you and those before you—it may lead you to piety, so that you fear Him by worshipping Him, for nothing protects from His punishment except obedience to Him. In other words: that you may safeguard yourselves from My punishment and from the Fire, for only the worship of your Lord who created you and those before you can shield you from them.
He then continued to present evidence of His Lordship and the obligation to worship Him by saying, “who made the earth a resting place for you,” that is, a carpet—and Allah