Sure Al-Baqara

2:102

وَٱتَّبَعُوا۟ مَا تَتْلُوا۟ ٱلشَّيَٰطِينُ عَلَىٰ مُلْكِ سُلَيْمَٰنَ ۖ وَمَا كَفَرَ سُلَيْمَٰنُ وَلَٰكِنَّ ٱلشَّيَٰطِينَ كَفَرُوا۟ يُعَلِّمُونَ ٱلنَّاسَ ٱلسِّحْرَ وَمَآ أُنزِلَ عَلَى ٱلْمَلَكَيْنِ بِبَابِلَ هَٰرُوتَ وَمَٰرُوتَ ۚ وَمَا يُعَلِّمَانِ مِنْ أَحَدٍ حَتَّىٰ يَقُولَآ إِنَّمَا نَحْنُ فِتْنَةٌۭ فَلَا تَكْفُرْ ۖ فَيَتَعَلَّمُونَ مِنْهُمَا مَا يُفَرِّقُونَ بِهِۦ بَيْنَ ٱلْمَرْءِ وَزَوْجِهِۦ ۚ وَمَا هُم بِضَآرِّينَ بِهِۦ مِنْ أَحَدٍ إِلَّا بِإِذْنِ ٱللَّهِ ۚ وَيَتَعَلَّمُونَ مَا يَضُرُّهُمْ وَلَا يَنفَعُهُمْ ۚ وَلَقَدْ عَلِمُوا۟ لَمَنِ ٱشْتَرَىٰهُ مَا لَهُۥ فِى ٱلْءَاخِرَةِ مِنْ خَلَٰقٍۢ ۚ وَلَبِئْسَ مَا شَرَوْا۟ بِهِۦٓ أَنفُسَهُمْ ۚ لَوْ كَانُوا۟ يَعْلَمُونَ

Und sie folgten dem, was die Teufel unter der Herrschaft Sulaimans (den Menschen) verlasen. Nicht Sulaiman war ungläubig, sondern die Teufel waren es, indem sie die Menschen in der Zauberei unterwiesen und in dem, was auf die (beiden) engelhaften Männer) in Babel, Harut und Marut, herabgesandt worden war. Und sie (beide) unterwiesen niemanden (in der Zauberei), ohne zu sagen: "Wir sind nur eine Versuchung; so werde (darum) nicht ungläubig." Und so lernten sie von ihnen (beiden) das (Zaubermittel), womit man Zwietracht zwischen den Ehegatten stiftet. Doch können sie damit niemandem schaden, außer mit Allahs Erlaubnis. Und sie erlernten, was ihnen schadet und nicht nützt. Und sie wußten doch, daß, wer es erkaufte, am Jenseits wahrlich keinen Anteil hätte. Fürwahr, wie schlimm ist das, wofür sie ihre Seelen verkauft haben, wenn sie (es) nur wußten!

Tafsir 2:102

When they left the path of Allah, they followed instead what the satans said: lying about the kingdom of the Prophet Solomon (peace be upon him) by claiming that it was established through black magic. Solomon did not disbelieve by practicing black magic, as the Jews claimed; but the satans were disbelievers when they taught people the black magic revealed to the two angels, Hārūt and Mārūt, in the city of Babel in Iraq. These two angels would only teach black magic to someone after explaining that they were simply a trial and a test for people, warning them not to be ungrateful to Allah by learning it. Those who learned black magic from them but did not listen to their advice would, through it, separate a man and his wife by sowing hatred between them. These sorcerers are not able to harm anyone except with Allah’s permission and by His will. They learn what harms them and does not benefit them. This group of Jews knew that whoever exchanges the scripture of Allah for black magic will have no portion in the Afterlife. What an evil thing they sold their souls for when they exchanged the revelation and sacred law of Allah for black magic! If they had known what would benefit them, they would not have done something so disgraceful and clearly misguided.