God planned:
God was thinking of you even before he made the world, that is why he created the world
God's purpose even took in account sin and human error.
If there was no god, we would all be accidents
The only accurate way to understand ourselves is by what God is and by what he does for us - Romans 12:3