Rom 8:29 For whom He foreknew, He also predestined to be conformed to the image of His Son, that He might be the firstborn among many brethren.
Is God unjust in saving some and not others? The potter and the clay illustration explains this in Rom 9:21-23. The whole human race deserved destruction; but for reasons not perfectly known to us, God determined to recover SOME by regeneration and the power of His grace. He who foreknew also predestined (predetermined, foreordained) those He called to be conformed to the image of His Son. How God does it is mind boggling, our finite minds cannot comprehend it.
Psa 37:39 “But the salvation of the righteous is from the LORD”. If they are righteous meaning saved, what other salvation should the righteous expect? First, the righteous are those He makes righteous by drawing them by His gospel, Joh 6:44 “No one can come to Me unless the Father who sent Me draws him; and I will raise him up at the last day”.
The salvation begins with justification (have been saved from the penalty of sin). Salvation of the righteous continues in sanctification (being saved from the power of sin), being conformed to the image of His Son. Then glorification (shall be saved from the presence of sin), and that is in heaven. In summary, we “being confident of this very thing, that He who has begun a good work in you will complete it until the day of Jesus Christ;” (Php 1:6).