People were predestined to eternal life before the foundation of the world, but this predestining/electing was done in accordance with God's foreknowledge of all future events on earth. It is not at all like the Calvinistic doctrine of Predestination.
Romans 8:30
Moreover whom He predestined, these He also called; whom He called, these He also justified; and whom He justified, these He also glorified. nkjv
1 Peter 1:2
elect according to the foreknowledge of God the Father, in sanctification of the Spirit, for obedience and sprinkling of the blood of Jesus Christ: Grace to you and peace be multiplied. nkjv
God did not arbitrarily choose some people to save and some people to condemn. God does not force people to obey Him and God does not prevent people from obeying Him. God does not force people to disobey Him and He does not prevent people from disobeying Him.
Before the foundation of the world, God knew which of the people that He would later create would still be faithful to Him at the time of their death. These people He predestined to eternal life. These people who He predestined to eternal life according to their works, He also called, justified, and glorified because He already knew all the works of every person before the foundation of the world.
Hebrews 4:3
For we who have believed do enter that rest, as He has said: “So I swore in My wrath, ‘They shall not enter My rest,’” although the works were finished [known] from the foundation of the world. nkjv
Our works matter.
Matthew 13:36-43
Then he left the crowds and went into the house. And his disciples came to him, saying, “Explain to us the parable of the weeds of the field.” 37 He answered, “He who sows the good seed is the Son of man; 38 the field is the world, and the good seed means the sons of the kingdom; the weeds are the sons of the evil one, 39 and the enemy who sowed them is the devil; the harvest is the close of the age, and the reapers are angels. 40 Just as the weeds are gathered and burned with fire, so will it be at the close of the age. 41 The Son of man will send his angels, and they will gather out of his kingdom all causes of sin and all evildoers, 42 and throw them into the furnace of fire; there men will weep and gnash their teeth. 43 Then the righteous will shine like the sun in the kingdom of their Father. He who has ears, let him hear. rsv