There is much about evil we don’t understand — nor will we understand it fully until we enter heaven. Some day all our questions will be answered — but not yet.
However, the Bible is absolutely clear about the question you’ve raised: Evil did not originate with God, nor is He in any sense the author or source of evil. God is absolutely pure and holy and good, and He is without sin of any kind — far purer than we can even imagine. The Bible says of God, “Your eyes are too pure to look on evil; you cannot tolerate wrong” (Habakkuk 1:13). We are a mixture of good and evil — but God isn’t, nor will He ever be.
Where, then, did evil come from? The Bible indicates that before the world was made God created the angels. But they weren’t robots; they had a free will — and some of them chose to rebel against God. They wanted to take God’s place — and from that moment on evil became a reality (see Isaiah 14:12-15).
Yes, evil is real — but so is God, and so is His goodness and His power. That’s why I invite you to come to Jesus Christ and find your hope in Him. He alone gives us victory over evil — victory in our lives right now, and victory over evil forever when He comes again.