The word "if" does not apply to God. God is the ultimate being, the essence of existence, the one in whom reality itself finds root. All things exist by and through him.
Consider the question, "if 2+2=5, what is the square root of 4?" The "if" in that question makes it nonsense, because if 2+2 were to equal 5, that would mean everything about mathematics would have to change. What does multiplication or square root mean, if 2+2=5? We would have no idea. Hence the implication of the "if" condition makes everything change in such a way that the question cannot even be sensibly posed.
Another example would be "if the dinosaurs hadn't died out, would Barack Obama still have won the 2008 election?". The question is nonsense. The "if" condition requires postulating such a vague, ill-defined universe that the second half of the sentence - the question - cannot possibly be answered in that universe.
We can think of many such questions. "if I were a butterfly, when would my birthday be?" "If the speed of light depended on the observer, would the Tycho Brahe still have observed the 1572 supernova?" "If the rules of logic didn't exist, what would be the population of the United States?" All of them are nonsense.
But God is the absolute being. He is the one on whom all other things are contingent. Postulating an "if" to God - that is, postulating what things would be like if God were different - involves postulating such a totally different state of things that no question can be sensibly answered.
Note that the Bible contains virtually no instances of "if" applied to God in the conditional, "what if" sense. Try doing a search on "if God" in the Bible. Nearly all the results fall into two categories. They are either a statement of ignorance on the part of a human speaker, (for example, "If God will be with me and watch over me..."), or a statement of logical implication that can also be stated as "since God..." (for example, "If God is for us, who can be against us?"). Nearly none of them are speculations or reasoning based on God being different from who he is. The only possible exception that I can see is Romans 9:22, which is a notoriously difficult verse on a difficult and controversial topic (predestination). It is the only verse which contains the phrase "what if God" in many English translations of the Bible. But let us leave the difficult topic of predestination for a future time: for now, there is strong Scriptural support for the idea that it is meaningless to speculate on God being different somehow.
Look for people saying "what if God..." in your conversations and readings. If the statement that they're making seems like nonsense to you, it's almost certainly because it is.
You may next want to read:
Can God make a rock so heavy that he cannot lift it?
Another post, from the table of contents