(18–19) “Then We set you upon a law of Our command, so follow it, and do not follow the desires of those who do not know. They will be of no avail to you against Allah whatsoever. Indeed, the wrongdoers are allies of one another, while Allah is the Protector of the righteous.”
That is, We prescribed for you a perfect law, stemming from Our religious command, which calls to every good and forbids every evil. “So follow it,” for following it brings eternal happiness, righteousness, and success. “And do not follow the desires of those who do not know”—those whose desires are neither governed by knowledge nor guided by it. This includes every whim and desire that conflicts with the law of the Messenger, may Allah bless him and grant him peace, for it belongs to the desires of those who do not know.
“They will be of no avail to you against Allah whatsoever.” That is, they will not benefit you before Allah by securing good for you or warding off evil from you if you follow their desires. Nor is it fitting for you to agree with them or take them as allies, for you and they are utterly distinct. They are allies of one another, “while Allah is the Protector of the righteous”: through their piety and obedience to Him, He brings them out of darkness into light.