Have a plan for when you hit the wall.
It may come at different points for different people, but everyone hits a wall at some point. My mom gave me an awesome tip: have a kickass playlist, but don't start listening to music until you hit the wall.
I was really struggling mentally when my legs started cramping around mile 14, so I put my headphones in and it was a game changer. I also had 26 friends and family members each write me a note, which my mom then laminated, hole-punched, and put through a safety pin. I read one note at the start of every mile, pinned it back to my pants, and let their note carry me until the next mile. Some were funny, some sweet, some serious, but each one gave me so much strength.