The state of your mind is fully dependent on the state of your body. If you aren’t taking care of your body nothing productive will come from your mind. It’s really that clear-cut.
This is because the mind’s evolutionary role is to aid the body. When animals in the past helped the mind but hurt the body, their genes did not prosper. So your genes are based on animals that took care of both mind and body.
If the body is the most improtant thing, how can you make that a priority for you? First you have to understand that nothing is set in stone. All of your habits and behaviors were built over time. They can be changed over time. If you take the changes gradually you are much more likely to keep with it in the long run.
Stop pushing your body to do things it’s telling you is not right. The body is much older and wiser than the mind. Listen.