The optimal page replacement algorithm will select the page that - Will not be used for the longest time in the future.
And that's the reason this optimal Page replacement algorithm is not a practical one and only used for benchmarking because one can never look into future and make decisions in present and that implies in real life too otherwise life would be no fun and boring because then we all take the perfect decisions!