Ephesians 1:4 tells us that God chose those who would believe in him before the foundation of the world. In fact, verse 5 tells that he predestined those whom he chose for adoption. One thing that we learn from this is that God's knowledge certainly knows no timely boundary. In other words, he didn't have to wait for us to be born to find out that we were going to be here. His knowledge of the entire human race, from Adam all the way to the last human that is ever born is exhaustive and has been from eternity past. Now, certainly we didn't exist before the foundation of the world, yet God's knowledge of us did. It is absolutely incredible!
Another observation that we can make is that God's choice of us had nothing to do with our behavior in this life. He wasn't choosing on a merit-based system. In fact, in another epistle we find out that the saving that God does is "not because of works done by us in righteousness, but according to his own mercy" (Titus 3:5).
One fallacy that some people can fall prey to is the idea that the election and predestination of God somehow negate all obligation on the part of the person. The fact is, that while God knows everyone from eternity past and chooses some only because of his mercy, everyone is born into sin which separates us from God (cf. Rom. 3:23). In fact, in the letter to the Ephesians, Paul said that those believer that he was writing to used to be dead in their trespasses and sins in which they once walked (Eph. 2:1-2). What do we say to this then? Well, we want to somehow make the transition from spiritual death (Eph. 2:1) to life. John said that the purpose of his gospel was so that people would believe that Jesus was the Christ, the Son of God, and that by believing, they would have life in his name (Jn. 20:31).
The answer is faith. God is presently calling everybody to repentance (Acts 17:30). They are to repent of their sins, and look to Jesus, the founder and perfecter of our faith (Heb. 12:2) for life (Jn. 14:6), who by his death and victorious resurrection from grave removed the wrath of God that rests on every soul (Jn. 3:36).
Put simply, when asked what must be done to be saved, Paul replied to the Philippian Jailer "Believe on the Lord Jesus and you will be saved" (Acts 16:31). So then, let us understand that God's omniscience doesn't negate our need for faith!