The Messenger of Allah ﷺ was asked, "What do you think of medicines we use for treatment, incantations we seek healing through, and protective measures we take? Do they avert anything from the decree of Allah?"He replied, "They are themselves part of the decree of Allah."
حدثنا محمد بن الصباح أنبأنا سفيان بن عيينة عن الزهري عن ابن أبي خزامة
سئل رسول الله ﷺ أرأيت أدوية نتداوى بها ورقى نسترقي بها وتقى نتقيها هل ترد من قدر الله شيئا قال هي من قدر الله
Its isnad is daif. Tirmidhi narrated it in the Book of Medicine, chapter on charms and remedies, hadith no. 2065, from the hadith of Ibn Uyayna with this wording, and he said, hasan sahih.Ibn Abu Khuzama is unknown (as stated in Taqrib and elsewhere), while Abu Khuzama is a companion, and his narration is the stronger one. The hadith has other routes with daif chains, among them the hadith of Hakim, 1/32, which he graded sahih according to the criteria of the two Shaykhs, and Dhahabi agreed with him, though it contains Zuhri's use of "an" (indicating an unspecified link in transmission).