In Doctor Strange, the Ancient One knows that she is going to die soon because she cannot look past a point in the future, and believes it to be when she will die.
However, we also know from Infinity War, that Doctor Strange was able to look past the point of his own death, and determine how to undo the “snap”, but we can put that down to the assistance of the eye of Agamatto and the Time Stone.
However, the question remains: Why is it that you can’t look into the future past your own death?
However, Strange was also dead during the time of Thanos’ defeat, so if that’s the case, it seems illogical that he would be able to see into it. Unless being able to revive after the fact was evidence that some sort of defeat happened, allowing him to come back in the first place.
Removed by mod