The first thing a person should always do is turn to Allah in all situations.
It’s sad to see people fleeing to medicine and doctors straight away. This tells a lot about a person’s tawakkul in Allah.
Secondly, Insha’Allah, there is no harm in taking medication as long as one knows that the cure is from Allah and this is just a means only. It has no power in and of itself.
Most madhabs say it’s allowed and some say preferred.