He did not say this on his own, but being high priest that year he was prophesying that Jesus was about to die (apothnēskein | ἀποθνῄσκειν | pres act inf ) for the nation,
Reference
John 11:51
Sequence
40