There are three verses in Scripture which specifically state that God foreknew what was going to happen before it occurred: He foreknew that His Son would be crucified before the foundation of the world (Acts 2:23; Heb. 9:26; Rev. 13:8); He foreknew those of us who would accept Jesus as our Lord and Savior before the foundation of the world (Rom. 8:29; Mt. 25:34; Eph. 1:4); and His foreknowledge determined whom He chose to be His children before the foundation of the world (1 Pet. 1:2; Jn. 17:24; Eph. 1:4; Rev. 13:8; 17:8). Notice that His children's names were written in the Lamb's Book of Life, and the names of the children of Satan were omitted from that book before the foundation of the world!
One of the greatest differences between man participating in the planning out of a criminal act, and God's foreknowledge of what happens, is motive. The criminal breaks both God's and man's laws for some selfish purpose. God allows man to break His and society's laws, but He is motivated by love for the lawbreaker. He offers forgiveness and salvation to all who will turn to Him through faith in Jesus Christ (Jn. 1:12; 3:16; Acts 10:34; Rom. 2:11; 10:8-13; Col. 3:25). Paul wrote: "And we know that all things work together for good to them that love God, to them who are the called according to His purpose. For whom He did foreknow, He also did predestinate to be conformed to the image of His Son, that He might be the firstborn among many brethren. Moreover whom He did predestinate, them He also called: and whom He called, them He also justified: and whom He justified, them He also glorified" (Rom. 8:28-30).
God is love! All that He does and allows is motivated by love! Trust Him!