We should all try to be healthy, because a writer depends on his/her brain for their work. If your brain is not working properly, neither is your writing.
Get plenty of rest, 6-8 hours a night. Sometimes we get too much rest and can't function. For years, I have felt better with a fifteen minute nap in the afternoon. When I sleep for an hour, I know something is wrong. That is not my sleep clock working properly.
Get the right kind of food. My husband is a diabetic and I'm borderline. What we eat is very important and lately I have not been eating like I should. I've put on a few pounds and I must get them off. We are eating more veggies, less sugar and bread, and a good amount of lean meat and fruits. It's hard and you have to stay on track with what you're doing.
Exercise is one of the things most writers lack. I know I do. I sit too much and I have no excuse. There is a track across the road from me, but I'd rather go to the park and walk. The scenery is better. It takes effort to get in the car and drive the few miles to get there, so mostly I don't. Exercise also helps you to think better. The blood runs through your body better and your body works more smoothly.
Have a good attitude. How do you get that? You have to begin by having pleasant thoughts. No hatred or malice should be in your brain. As a Christian we shouldn't have that anyway. Study God's Word each day and pray about your work and other people will keep your mind focused.
The last thing to do is play. Take a day off and let your mind rest. It's hard to do sometimes, but we need to rejuvenate our bodies and soul.