Islam teaches that Destiny (nasib) is written with your own hands, then handed over to God, and He gives the judgement. The good and evil (khair and sharr) are in Allah's responsibility, the essence and the manifestation (dhat and sifat) is developed by man. God has created man and woman and given us the destiny of a created being. He has given them ninety-nine characteristics (tattwas) saying, "This is your destiny. Go accomplish what you have to with this and come back. If you gather good things, you will attain heaven, but if you gather what is evil, then you will attain hell. Whatever you bring back will be your final judgement. I will finalize that as your destiny. I am giving the decision of your destiny into your hand (qala qadir). Go, finalize it, and come. Whatever conclusion you reach (qada) becomes your decreed destiny (qala qadir)."
Some muslims says that if they do not realize this and prepare hell for themselves, then God will not give them heaven. God has not said, "Whatever I have given you is your destiny!" He will change your destiny according to your intention. Whenever you ask for forgiveness, instantly He will forgive you. As you repent and as your understanding of yourself increases, He will forgive you. As you intend Him more and more, He will grant you the benefits. If He had already written your destiny, He would not grant these things. He has given you the ability to repent (taubah), and He has given you forgiveness. Since He has given you both the faults and the remedy for it, He grants forgiveness when you ask for it.