God is omnipresent, which means not only is He everywhere at once, He is every-time at once. Before God even created humans, or even anything at all, He knew what was going to happen. Which means He also knew how to fix it. Jesus coming as a baby, living the perfect life we couldn’t live, sacrificing Himself for our sins on the cross, and rising again to proclaim victory over death, was already planned.
God loves us so much that even though we were going to mess up, He pre-planned a way to fix the damage and created us anyway. As always, God knew what we needed before we even needed it, and had things in place to provide.