Sayyiduna Abu al-Darda' (may Allah be pleased with him) said that the Messenger of Allah (peace and blessings be upon him) said: "Allah has sent down both the remedy and the disease, and for every disease there is a remedy. So seek treatment, but avoid treating yourselves with what is unlawful."
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الضحايا / 19681
Sayyiduna Abu Hurayrah (may Allah be pleased with him) said that the Prophet (peace and blessings be upon him) forbade "unlawful medicine."
Note: Treatment with an intoxicant or an unlawful medicine without necessity is forbidden, so that the two hadiths may be reconciled.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الضحايا / 19682
Nafi' said: Whenever Ibn Umar (may Allah be pleased with them both) called a physician (doctor) to treat someone of his family, he would make it a condition that he would not use anything that Allah has made unlawful.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الضحايا / 19683