Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:20:73

Indeed, we have believed in our Lord that He may forgive us our sins and what you compelled us ˹to do˺ of magic. And Allah is better and more enduring."  

Indeed We profess belief in our Lord, that He may forgive us our sins, in the way of ascribing partners ˹to God˺ and otherwise, and the sorcery to which you forced us, to learn and to perform in order to oppose Moses. And God is better, than you in rewarding if he is obeyed, and more enduring’, than you in chastisement if he is disobeyed.
القرآن:٢٠:٧٣

إِنَّا آمَنَّا بِرَبِّنَا لِيَغْفِرَ لَنَا خَطَايَانَا وَمَا أَكْرَهْتَنَا عَلَيْهِ مِنَ السِّحْرِ ۗ وَاللَّهُ خَيْرٌ وَأَبْقَىٰ  

{إنا آمنا بربنا ليغفر لنا خطايانا} من الإشراك وغيره {وما أكرهتنا عليه من السحر} تعلما وعملاً لمعارضة موسى {والله خير} منك ثوابا إذا أطيع {وأبقى} منك عذابا إذا عصي.