I have been struggling with a sin for quite some time now, but have had little success in quitting. It leaves me wondering why Allah SWT has not granted me a way out of it. I've struggled for years and have tried so many different things, but nothing has worked. Am I doing something wrong on my part that may block me from receiving Allah's help? I'm confused as to why He has not granted me the ability to stop sinning?

لَهُ مُعَقِّبَاتٌ مِّن بَيْنِ يَدَيْهِ وَمِنْ خَلْفِهِ يَحْفَظُونَهُ مِنْ أَمْرِ اللَّهِ إِنَّ اللَّهَ لَا يُغَيِّرُ مَا بِقَوْمٍ حَتَّىٰ يُغَيِّرُوا مَا بِأَنفُسِهِمْ وَإِذَا أَرَادَ اللَّهُ بِقَوْمٍ سُوءًا فَلَا مَرَدَّ لَهُ وَمَا لَهُم مِّن دُونِهِ مِن وَالٍ

For his sake there are angels following one another, before him and behind him, who guard him by Allah's commandment; surely Allah does not change the condition of a people until they change their own condition; and when Allah intends evil to a people, there is no averting it, and besides Him they have no protector.(13:11)
There is a famous saying:
“God helps those who help themselves.”
Allah (swt) has given us an intellect which differentiate us from other animals. If I ask anyone to jump from a high building will he be able to do so?? While he knows how to jump. But he will never do such silly mistakes why because it’s Cristal clear for him that he would either die or get severe injuries. Same way we Human do Gunah frequently because we don’t know the consequences of that Gunah. That is why Quran is warning us in every step of our life. That what is wrong and what is right.
Make sure a Human remains Human as long as he listens his inner voice (zameer) and when his desires get dominant over his intellect he becomes a wild animal.
That is why Allah has given us an intellect to follow His path in the light of Quran.
Strengthen your will power inshallah you will be able to get victory over your desires.