There's a fascinating theory that involves the omniscience of God (that God is all-knowing) that I repeatedly find helpful. It comes up in conversation here and there, and so I want to give it a very brief treatment here. However, you can read something much more complete and academic about the topic here (including some objections to the theory):
This theory is called Middle Knowledge, first proposed by Luis de Molina in the 16th Century. In basic terms, it states that logically prior to creating our universe, God had knowledge of all possible universes. In his omniscience, he could imagine every single possible universe and furthermore, knew all the endings from the beginning of those universes.
Then, after being able to imagine all possible universes and their outcomes, God chose to instantiate this one, knowing from the beginning everything that would happen as a result of His choice. In other words, God chose to create a universe where all that we see happen would happen. Otherwise, He would have created a different universe.
This theory allows humans the freedom to choose and for God to remain perfectly sovereign. God guarantees the outcome of the universe by instantiating this one as opposed to any other one, but the decisions within this universe we make are not forced by Him.
Furthermore, we can assume that God always chooses the best. Therefore, it was best to instantiate this universe compared to all others. Not that this universe is best in every respect, but instantiating this universe was better than instantiating a different one.
This means that creating a universe where humans rebel against God and then Jesus comes to die for their sins is better than creating a universe where man never sins. That's hard to accept, for sure. But it's harder to accept God knowingly making a less than best decision to create.
This also means that instantiating a universe where Hitler comes to be is somehow "better" than instantiating a universe where he does not. Wow. This is not saying that Hitler existing is better than Hitler not existing, but that instantiating this universe where Hitler exists is somehow better than instantiating one where he does not. In some way in God's economy, His purposes are better served in this universe.
This speaks to an incredible depth of God's knowledge and a kind of ethical economy we simply can't comprehend.
Not all philosophers buy into this theory. There are some objections to it (most of them in esoteric philosophical constructs). I'm not suggesting this is the theory that we all must accept.
However, I do find this idea immensely interesting and often very helpful. It matches many attributes of God we know to be true, it matches our perception that we choose things with some degree of freedom, but it also requires a tremendous amount of faith in God's omniscience and goodness.