I hated going to her class, so getting sick at school gave me an excuse to go home, get away from her, and let me be with my Mom. It didn't hurt, either, that my mom was often nicest to me when I was sick. As strange as it may seem, illness does serve a function. The illness isn't going to go away until you figure out what purpose it serves. Even if you do go to the trouble to find out what purpose your illness serves and what you need to do to fill that purpose another way, you may choose not to do so.
People do it all the time.
I am a perfect example of this. To put it gently, my health habits are not the world's best. Despite all scientific evidence to the contrary, I continue to smoke cigarettes. I know how to quit - and did so for four and a half years at one point. I know why I should quit - my sinuses would work better, I wouldn't smell like smoke, and I would probably reduce my risk of contracting lung cancer, heart disease, emphysema, and who knows what else.