Bamidbar22:12

וַיֹּאמֶר אֱלֹהִים אֶל־בִּלְעָם לֹא תֵלֵךְ עִמָּהֶם לֹא תָאֹר אֶת־הָעָם כִּי בָרוּךְ הוּא׃

And the Almighty said to Bilam: "You shall not go with them, you shall not curse the people, for they are blessed."

Bamidbar 22:12

וַיֹּאמֶר אֱלֹהִים אֶל־בִּלְעָם

Bamidbar / Numbers 22:12 · Pshat

Bamidbar 22:12

וַיֹּאמֶר אֱלֹהִים אֶל־בִּלְעָם לֹא תֵלֵךְ עִמָּהֶם לֹא תָאֹר אֶת־הָעָם כִּי בָרוּךְ הוּא׃

And the Almighty said to Bilam: "You shall not go with them, you shall not curse the people, for they are blessed."

Pshat פְּשָׁט

Do not go with them

Sometimes you are called to a place where you will help no one and only watch from the side. It seems harmless: just to look. Here the Almighty forbids Bilam even that.

Sforno: even without a curse Bilam (Balaam) must not go, so as not to cast an evil eye on the people. Chizkuni: the Almighty knew there would be a plague over Baal Peor and did not want the world to credit it to Bilam's curse. Netziv: with them Bilam would have travelled the King's Road and seen the people, but going to Balak at all He did not forbid.

How Sforno, Chizkuni, and Haamek Davar explain it

Sforno Do not go with them

Even if you do not curse them, do not go, so that you do not cast an evil eye on them. As the sages said: "He cast his eyes on him, and he became a heap of bones" (Sanhedrin, chapter "Chelek", and Bava Batra, chapter "Who sells a ship").

Chizkuni Do not curse the people

It is revealed and known before the Holy One, blessed is He, that there will be a plague over Baal Peor. And had Bilam (Balaam) cursed them, the world would have said: the plague came because of Bilam's curse.

Haamek Davar Do not go with them

They travel by the King's Road, and from there Bilam's eye will reach the people. This is the main precision in the words of the Holy One, blessed is He, who said "with them". But going to Balak at all He did not forbid him, and this will be explained further.

Takeaway

"Chelek" and "Who sells a ship" are the names of chapters of the tractates Sanhedrin and Bava Batra in the Talmud.
The plague came when the people attached themselves to Baal Peor, an idol of Moav (Moab), and twenty-four thousand died (Bamidbar / Numbers 25:3, 25:9).
The King's Road is the way by which Israel asked to pass through Edom and through the land of Sichon (Bamidbar / Numbers 20:17, 21:22).