God is omniscient because He knew before the foundation of the world who would and who would not accept His truth and maintain that truth until death.
AMEN.
Therefore because of His foreknowledge He predestined those who would believe to a life of good works that bring praise to the glory of His name (read Ephesians).
AND AGAIN I SAY, AMEN.