The short answer is that he doesn't. The longer answer is Series 6, especially "The Impossible Astronaut"/"Day of the Moon", "A Good Man Goes to War", "Let's Kill Hitler" & "The Wedding of River Song" (the finalé).
As eventually disclosed in the finalé, the events at Lake Silencio were a fixed point in time; they had to happen (& the finalé showed the catastrophic effects of preventing them from happening).
The Silence chose Lake Silencio specifically because it was a "still point in time" (a term that has never been explained in any detail) & that made it easier for them to create a fixed point. They wanted to ensure that the Doctor's death was a fixed point because they wanted him to be unable to avoid it even if he had been forewarned about it.
The Doctor, however, outsmarted them. Since he couldn't avoid it, he arranged for the fixed point to consist of events that were not what they appeared to be -- not what the Silence (& we) thought had happened.
As the finalé showed, the Doctor had to allow the shooting to happen but the shooting didn't kill him. River & Canton were lying about that & the Viking-style boat cremation was a trick to prevent anyone else (especially the Silence) discovering that the Doctor hadn't been killed.