There is the philosopher called Mill in the west in the modern times, while dealing with this problem, he said that considering God on one hand and considering the world on the other, you conclude that God is either good or omnipotent but not both. God is either good or omnipotent but not both, because if he is good and also omnipotent there could have never arisen evil at all.
If he is omnipotent and he is good then evil cannot arise out of him and still if evil exists and yet you insist that he's also omnipotent; then it means that God himself must not be good. Because if he was really good and omnipotent, he would have killed evil, if he is omnipotent and yet evil exists then it means that he allows evil to exist. If God is not opposed to evil, then God also must be himself in some way evil. Either he himself is producing evil out of himself or is evil has not come out of him and he is omnipotent, he is not killing it, therefore, he allows evil to exist. Therefore, in his own consciousness evil is not something objectionable that can be only, if he himself is not good. Or if he is himself is omnipotent and yet he allows evil and yet does not kill evil, he must be full of evil. One who allows evil although capable of taking it out, he himself must be mischievous, sadist, He can destroy the evil and he is omnipotence and yet he doesn't do anything when evil is there all-around, why doesn't He just come down on evil and kill it at once. It must be because although he's capable of destroying, he says it doesn't matter and see how the drama goes on, so he's like a very cruel man.
Therefore, if you really want to say that God is very good and very compassionate and grant that he's not omnipotent. Although he would like to destroy evil, he's not able to do it, therefore, evil exists that kind of proposition is admissible. If God exists but not omnipotent is admissible logically or God exists, who is omnipotent but not good in himself that is accepted logically. But to say that God is both good and omnipotent and yet evil existing that is logically impossible. And this is the argument that is extremely important, very powerful and it is opposed to what is called monism, monotheism, theism. All those theories regard God as both good and omnipotent and that theory is bombarded by this argument.
There are answers to this question which are offered by all monotheistic religions. Christianity is a theistic religion, Islam is a theistic religion, Judaism is a theistic religion, some forms of Hinduism are also theistic religions, Shaivism is theistic, Vaishnavism is theistic, so there are many forms of theistic religions. They are all monotheistic religions, there is only one God, therefore, they are called monotheistic religions.
Let us see how they answer these questions. According to one answer, God is both good and omnipotent, and out of his omnipotence and out of his goodness he has conferred upon human beings a free Will. And free Will itself is a goodwill and freedom is a good thing and God has given the freedom to man. God being good and omnipotent, he is given to man a free Will, which is a good thing; a good gift has been given by God. But man having got free will, he misuses freedom and all evil in the world is a result of the free will of man; it is not willed by God.
The evil is a resultant of the exercise of the will on the part of man because he is free, he can choose between good and evil and he is free to choose evil therefore, evil exists because he chooses it. But if it chooses evil and the question may be asked but God is omnipotent he could do two things, God is omnipotent, he could take away the freedom of man, if everything is because of the gift of God’s goodwill he could take it away, why does he not do it? Or else in spite of that there is evil in the world, he could alchemise everything because he is omnipotent, all evil things can be destroyed at once at one stroke. Even as the evil arises I may do something evil, God can optimise it to make it good, he could do it, if he is omnipotent. I may do a wrong thing and injustice is created, now, God can immediately come and put everything right, why does he allow injustice to remain? I may be doing injustice but God is omnipotent, fine, He allows me my freedom, I do an unjust act, God can immediately intervene and put it right, why does he not do it, he is omnipotent? This is the argument which baffles theists and there are various kinds of answers which are given. One answer is the following, God has given goodwill to man, the goodwill itself is a good thing, therefore, God wants that by his own will he chooses good. God wants man to arrive at a point where he chooses willingly, the good. And since choosing God willingly is more valuable than compelling man to choose God or good, therefore, God is allowing this free will to remain. Fine, this can be an answer that alright God wants a willing will, a freedom in man to choose God which is the greater good than asking man to be compelled to choose God but then the deeper question is not answered by this.
In the meantime, so much injustice is going on in the world, if it is only the question of asking man to choose God really, fine, and again it is quite alright but in the meantime innocents are killed, fire breaks out and destroys the world in many important matters and there are blind forces working in the world and God doesn't intervene then the answer comes that all that is evil in the world is a method of God, to train the individuals. If I choose evil then God punishes me, so He trains me so gradually that I learn how to choose God. God does not compel me to choose God, but He punishes me so that I may awake and gradually come to understand one or the other and ultimately choose God. So, it is argued that all evil in the world is in the form of punishment, it's a kind of a school in which the souls who were given the freedom are trained, so that gradually with these experiences they will learn how to choose good, instead of choosing evil.