I have invented a medicine for a very popular skin disease. After some googling I learned that there is not a known cure. This medicine is made from extraction of a chemical change of a certain plants. Can this medicine be patented? If yes, is it wiser to patent it or make a contract with a pharmaceutical company?
Can this medicine be patented?
Yes. You have said your medicine is new. Given there is no current cure, the medicine is likely non-obvious too. Because of this, your medicine itself could likely be patented. In addition, if the method for producing it is also new and non-obvious (which is likely true for the same reasons), the method could also be patented.
Is it wiser to patent it or make a contract with a pharmaceutical company?
This is impossible to answer, as it depends on what your commercial situation is. Both options are valid and reasonable. You should almost certainly discuss this with a patent attorney.
One valid option is to apply for a patent yourself. The downside of this approach is that this would cost quite a bit of money, since patent attorneys are pricey. Although in principle you could do this without engaging a patent attorney, this would most likely result in a patent application that will never be granted.
Another valid option is to contact a pharmaceutical company before applying for a patent. However, if you disclosed it to the company out of confidence, this disclosure would likely prevent you getting a patent in the future. So you would likely need to have them sign a non-disclosure agreement before explaining your invention. This would likely need to be prepared by a lawyer.