Allah ﷻ says:
قُل إِنَّ الأَمرَ كُلَّهُ لِلَّهِ
“Say, “Indeed, the matter (every matter) completely belongs to Allah.”
It is Allah who enabled the servant to repent, then He ﷻ accepted it from him.
It is Allah ﷻ who enabled the servant to righteous deeds, then He ﷻ rewarded him for his deeds.
It is Allah ﷻ who enabled the servant to supplicate, then He ﷻ answered him.
Ibn Taymiyah, Al-Fataawah 14/382