The Prophet ﷺ said: Allah has sent down both the disease and the cure, and He has appointed a cure for every disease, so treat yourselves medically, but use nothing unlawful. (Using translation from Abū Dāʾūd 3874)
قَالَ رَسُولُ اللهِ ﷺ إِنَّ اللهَ ﷻ أَنْزَلَ الدَّاءَ وَالدَّوَاءَ وَجَعَلَ لِكُلِّ دَاءٍ دَوَاءً فَتَدَاوَوْا وَلَا تَدَاوَوْا بِحَرَامٍ