Is that true that dua has so much power that it can also change what’s written in your destiny (I read it somewhere).
The Quran says that if Prophet Yunus, peace be upon him, had not been among the musabbiheen (those who make it a habit to perform God’s remembrance), God would have not have saved him from the belly of the whale (verses 37:142-144 of the Quran).
This story suggests that what you do now can affect what destiny God chooses for you. If you do good, God will cause more good to come to you, and if you do evil, God can punish you with bad things happening in your life:
Whoever works righteousness, whether male or female, while being a believer, We will grant him a good life—and We will reward them according to the best of what they used to do. (The Quran, verse 16:97)
But whoever turns away from My Remembrance, for him is a constricted life. And We will raise him on the Day of Resurrection blind.” (The Quran, verse 20:124)
The Quran mentions that God helped prophet Musa (Moses) acquire knowledge and wisdom as a reward for being a virtuous person, meaning that if he had not been virtuous, he would not have had this reward:
And when he reached his maturity, and became established, We gave him wisdom and knowledge. Thus do We reward the virtuous. (The Quran, verse 28:14)
The same would apply to dua/supplication in its ability to change what future God enables us to have. If you pray for knowledge, God can arrange the circumstances for you to acquire it, but if you had not prayed, perhaps you wouldn’t have acquired that knowledge.
There are various schools of thought on these issues and you will get very different answers depending on who you ask. There is the Ash’ari creed, the Maturidi creed, the Mutazilite creed, the Hanbali literalist creed (traditionalist Salafis), each has its own theory of free will and destiny.