This is a question that has been around since the Fall of man, and which I do not have an "easy" answer to, but it is an important question that must be answered (to some degree) in the mind and heart of every believer: If I am to trust God, how should I think about the problem of evil?
Here are some, I hope, helpful principles:
#1 - God is good. - God is morally perfect. He cannot sin. Nor can He tempt anyone to sin.
Luke 18:19 -
#2 - God's ways are not our ways. - He is much wiser than we are. No one can search out His plans and decisions to fully understand them.
Isaiah 55:8 -
#3 - God brings good out of evil. - It is His way. That's what redemption means; all of biblical history is a story of redemption.
Isaiah 47:4 -
The sum of these principles gives us an idea of God's character: God is absolutely perfect. He does not and cannot sin because He cannot be tempted (this is also why Christ took the form of a man so that He could have a nature that could experience temptation).
God's ways are not our own, so we cannot expect to completely comprehend the ways of God by our own wisdom. There will be many things about God's character that remain a mystery to us which we will have to take on faith, but we can still trust Him because of all that He has revealed about Himself.
Observing the history of mankind, God has always been about the redemption of people (and Creation). He was and is Israel's Redeemer; He is the Redeemer of the Church; He is the Redeemer of Creation and History itself. He makes miracles out of messes and heals what is broken.
Finally, questions of how God could ever have used godless societies to chasten Israel--societies that had no mercy on the helpless and defenceless like women and children (Isaiah 13:17-18)--and how God could use a sinner such as Satan to bring about His purposes (see Job) should always be viewed in light of the singularly darkest and most evil day in the history of the universe: the crucifixion of Jesus Christ.
On that day, the greatest evil ever committed took place. The Son of God--God in the flesh--who was absolutely and altogether blameless...was betrayed into the hands of sinners who put Him to death, though He was deserving of no such thing.
If you want to ask how? Ask how God could possibly crush His only begotten Son for the sake of sinners like you and me (John 3:16). Ask how God could possibly say it "was His will to crush Him" (Isaiah 53:10). Ask how He could make Christ to be sin, that we might be made His righteousness (2 Corinthians 5:21)
The greatest evil ever committed...against the most innocent of persons who ever existed...became the single greatest and most blessed event in all eternity past or present! For, through Christ's stripes we are healed (Isaiah 53:5), that He might be the firstborn among many brethren (Romans 8:29) and bring MANY sons to GLORY (Hebrews 2:10)!
Praise be to God, who even uses our evil for His good ends (Genesis 50:20)! And that it all exalts His most Holy Name (Psalm 106:8)!