Jabir b. 'Abdullah reported I had a maternal uncle who treated the sting of the scorpion with the help of invocation. Allah's Messenger (ﷺ) forbade invocation. He came to him and said: Allah's Messenger, you forbade to practise invocation, whereas I employ it for curing the sting of the scorpion, whereupon he said: He who amongst you is capable of employing it as a means to do good should do that.
Source: sunnah.com
Other translations
Arabic
حَدَّثَنَا أَبُو بَكْرِ بْنُ أَبِي شَيْبَةَ، وَأَبُو سَعِيدٍ الأَشَجُّ قَالاَ حَدَّثَنَا وَكِيعٌ، عَنِ الأَعْمَشِ، عَنْ أَبِي سُفْيَانَ، عَنْ جَابِرٍ، قَالَ كَانَ لِي خَالٌ يَرْقِي مِنَ الْعَقْرَبِ فَنَهَى رَسُولُ اللَّهِ صلى الله عليه وسلم عَنِ الرُّقَى - قَالَ - فَأَتَاهُ فَقَالَ يَا رَسُولَ اللَّهِ إِنَّكَ نَهَيْتَ عَنِ الرُّقَى وَأَنَا أَرْقِي مِنَ الْعَقْرَبِ . فَقَالَ " مَنِ اسْتَطَاعَ مِنْكُمْ أَنْ يَنْفَعَ أَخَاهُ فَلْيَفْعَلْ " .
sunnah.com