Hopefully this isn’t your first race. If it is you might want to start with a 5K or 10K. The best way would be to get a periodized marathon training program either online or from a qualified and experienced runner or coach. Follow the plan and peak for competition. Remember to stretch and foam roll your body after each run to help speed up your recovery.