Participating in a marathon requires an amazing amount of commitment and motivation. And it is easier to say than put it into practice. A good motivation technique to realize a goal is to imagine as if you have already achieved it. I have tried this a number of times on a lot of things where I felt that it was a tough goal to achieve, and being able to see myself achieve it definitely ends up as a great confidence booster. Motivate yourself to stick to your routine so that you can stand up and confidently tell yourself on the day of the event that you did everything to the best of your abilities to prepare for the event.