Does God have everything already planned and is he completely omniscient? In Isaiah 38:5, God tells Hezekiah he is going to die very soon but Hezekiah begs to the Lord to live and the verse says the Lord changed his mind and added 15 years to Hezekiah’s life. So did he already know he was going to add 15 years to Hezekiah’s life? if so why did he tell Hezekiah he was about to die when he was ill.
This is a question of predestination, an extremely slippery concept that has given theologians fits for all of Judeo-Christian history, caused massive conflicts among various denominations, and is still argued about today. The concept is tricky because scripture includes other examples in which God appears to change his mind in response to human pleading — besides the Isaiah verse you raise — for example, Gn 18:23-33. At the same time, the Bible also has many statements regarding the omniscience of God.
Consider Psalm 139:16: “Your eyes beheld my unformed substance. In your book were written all the days that were formed for me, when none of them as yet existed.”
There is a Catholic understanding of predestination that still insists on free will.
“To God, all moments of time are present in their immediacy. When therefore he establishes his eternal plan of ‘predestination,’ he includes in it each person’s free response to his grace.” (Catechism, 600)
One way to think about this is that God can and does “respond” to human changes (the situation changes, as when Hezekiah weeps bitterly and implores God to look upon his faithfulness), but that God does not change. God does know what is going to happen, but God is actually timeless so in that sense is not responding in real time. Our trouble in understanding any of the above passages is that it is almost impossible for us to think outside of our temporal mindset to understand a God who lives outside of linear time.