This is a classic question. When it’s a challenge to the Christian faith, trying to prove that God doesn’t exist, it’s usually phrased like this: “If God is truly omniscient (all-knowing) and omnipotent (all-powerful) and loving, how could he allow suffering and evil?”
Here is a classic answer.
God exists. Jesus said he does, and he rose from the dead to show that he could be trusted to tell the truth.
God is all-knowing. That trustworthy Jesus said so. And since God knows everything, he is smarter than we are. So he may do or say things that are perfectly right, but we don’t understand them, because we’re not as smart. We have that experience every day with people who are smarter than we are.
God is all-powerful. In philosophical terms, that doesn’t mean that he can do anything; that would lead to internal contradictions, as in, “Can God make a rock so big that he can’t lift it?” In philosophical terms, all-powerful means that he can do whatever he wants. He can always put his will into action. See the difference?
God is loving. God showed his love for all people by sending a Savior (John 3:16).
Does God allow evil to occur? That depends on how you define evil. Sometimes what seems bad or evil to one person seems good to another person.
But let’s grant that God does allow evil to occur. It’s only temporary. Death intervenes. Since God is smarter, perhaps that temporary evil actually turns out to be for some good in the end. For example, the Bible tells the story of a man whose brothers sold him into slavery. That was evil. But it turned out for good. The man himself said so (Genesis 50:20).
Since God is smarter than I am, I trust that when he allows evil or suffering in my life, it will work out for my good (Romans 8:28). Since he’s loving, I trust that everything really will work out for the best in my life. And since he’s all-powerful, I can ask him to get rid of the evil, and trust that if that’s he wants at that time, he can and he will (Matthew 7:7).