Christian Question: As the bible says, if I pray for God to forgive me, he will. So if God needs to do something bad (like breaking a deal) will he do that?
This Christian question has multiple parts: Will God break his promises? Does God do bad things? What does the Bible say about forgiveness?
According to the Bible, God will never break his promises, as stated in Numbers 23:19 NRSV, "God is not a human being, that he should lie, or a mortal, that he should change his mind."
God also says, "I will not break my covenant, Nor alter what my lips have uttered." (Psalms 89:34 WEB)
To break a promise is the same as lying, and God cannot lie (or do any sin). James warns us to take responsibility for our own temptation, saying, "Let no man say when he is tempted, 'I am tempted by God,' for God can't be tempted with evil, and he himself tempts no one." (James 1:13 WEB)
For more information about what God can and cannot do, read Are All Things Possible for God?
If you are concerned about the bad things that do happen in the world, remember that humans have the unique ability of independent will, which is why evil happens in the world.
"But each one is tempted, when he is drawn away by his own lust, and enticed. Then the lust, when it has conceived, bears sin; and the sin, when it is full grown, brings forth death. " (James 1:14-15)
And God will judge this evil, as Jesus explains in many of his parables, such as the Parable of the Weeds, "The Son of Man will send his angels, and they will collect out of his kingdom all causes of sin and all evildoers, and they will throw them into the furnace of fire, where there will be weeping and gnashing of teeth." (Matthew 13:41-42 NRSV)
However, remember not to confuse God being unable to break a deal with God answering a prayer. God is not a magic genie that he should obey our every wish and command. On the contrary, we are to be his servants, not the other way around.
One of the important factors that many neglect when considering forgiveness is the importance of repentance, which is the turning away from sin. Read about The Meaning of Repentance and Salvation for more information.