The only 4.0 I ever got:
The biggest thing that made the difference:
Staying hydrated. I never left the apt without my nalgene, and refilled it twice a day.
Sleep 8 hours/day. Even when I didn't finish all of my work, I'd make time for sleep. Having a clear mind makes all the difference where it matters.
Be reflective. I like to do something that I read about Ben Franklin back in high school, which is to end each day with a thought in a journal, answering the question "What good have I done this day?". It could be as simple as "I made my bed", or "I did laundry." Being mindful does wonders for your mental health, and being able to read back through all the good things you do can be a great pick-me-up in the bad parts of the semester.