No one particularly likes having to take medicine. (Not even doctors.)
No one likes being sick either, though.
So if you really think about it, when you go to see a doctor, it means somewhere in your mind (and probably not consciously), you’ve put the need to beat the illness above your dislike of taking medicine. In other words, you’ve made a trade-off. (In economics, that’s called the opportunity cost.)
Which is why you might be faithful with medication while the feeling of illness lasts, but the minute you begin feeling better you might relax, or just stop, and throw the doctor’s orders out the window. The dislike wins again. Another trade-off, only this time, in reverse.
And of course, you’re free to do as you please. It’s your body, your health, and you alone know what matters to you.
Only question is: Do you always realise what you’re trading off?