In the beginning, God created the heaven and the earth. (Gen 1:1) He knew exactly what He was doing. He didn't make something that was only "half-good." He made the best. It took some thought. He had foreknowledge of what He was going to do. He also knew what was going to happen in the future. (Omniscient) In Deuteronomy 32:4, His work is described as perfect.
God had plans, and He found people to fulfill His desires. Think of Noah. Noah built the ark just the right size to hold the animals that were going to be housed in the ark. How did Noah know how big to make it? Who told him? How about the exact amount of water needed to flood the earth? How did God know when to turn off the spigot? Trust me, HE knew it all!
How about Moses? Did Moses think that he would lead the Israelites out of Egypt? Moses constantly said he was unworthy (Exodus 3:11-12). He said that he couldn't speak (Exodus 4:10-12), but God still used Moses mightily.
Who is the ultimate in God's perfection? Jesus! Why Jesus? Jesus was at the creation of the world. To be a witness to that, He (Jesus) had to be a part of God. (Gen. 1:26) Jesus appeared several times in the Old Testament, but that is beside the point; Jesus was God's ultimate perfection. When Jesus came to earth, He was perfect. His Father was God, so He had to be!
Jesus was perfect while He was on earth. He never sinned (1 John 3:5), (2 Cor. 5:21). He couldn't, it wasn't in His nature. There was only One person who lived a sinless life; Jesus. He was/is perfect.
When Jesus died on the cross, He had not sinned. He became our substitute for the atonement for our sins. (You may ask here, how Jesus could be a substitution for my sins committed 2,000 years later.) In the Old Testament, God required the sacrifice of a perfect lamb (Lev. 22:19-21); nothing less would do. Since God was perfect, He expected His creation (humanity) to worship Him and HIM ALONE. When a sin was known to be committed, the person would come to the temple and make an offering of a unblemished lamb (Lev. 4:32) as that was the animal used for sin offerings. Since Jesus had not sinned, He became the substitution (Isa. 53:5-6), (Matt. 26:28) for our sins. When we ask Jesus/God to forgive us for our sins, He cleanses us from those sins. (1 John 1:7-9) He (God) can only cleanse us from our sins by accepting the sacrifice of His Son, Jesus as this substitution. No other way will do. . . Being a "good person", doing good things for others, helping the needy, hoping for the best. . . none of these things will forgive us for the sins that we have committed. Only the substitutionary sacrifice of Jesus 2,000 years ago. (1 Peter 2:24)
God had all of this planned before the beginning of time. Before the earth was created. God created not only the
but also the angels at some point.
At the end of each day of creation, it is stated that "God saw that it was good." (KJV) He did good work! As mentioned above, He also created angels including the archangels, cherubim and seraphim. One of the archangels that He created was a rebel and is called Satan or the Devil. God created Satan perfectly also (Ezek. 28:14-19). Satan became full of pride (Isaiah 14:12-20) and rebelled against God. He became the father of lies (John 8:44) and is deceiving believers into sinning to this day (2 Cor. 11:14), (Rev. 20:7,8).
Still, God is perfect and yes, He knew all of these things in advance. God still has a plan. He is still saving his perfect wrath for sometime in the future. At some point, God's stored up (Rom. 2:5-8) wrath will be released on Satan and the Earth. You won't want to watch the fireworks! It's all described in the book of Revelation. Decide now to accept Jesus as the substitution for your sins. He is perfect. He is waiting for your prayer of acceptance. Just repent of your sins and ask Jesus to enter your heart. He loves you and doesn't want the wrath to come to overpower you. If you need further assistance, here are two links: