There are a number of things you can do to avoid injuries while training for a marathon. These include:
Gradually increasing your mileage: Don't try to increase your mileage too quickly, as this can lead to overuse injuries.
Cross-training: Incorporate other activities into your training, such as swimming, cycling, or yoga, to give your running muscles a break.
Strength training: Strengthening your core and leg muscles can help to improve your running form and reduce your risk of injury.
Rest and recovery: Make sure to get enough rest and recovery between your runs. This will give your body time to repair itself and prevent injuries.