Most of the times this question is been asked, how can I stop doing bad things?
You do not have the power to stop them.
Even apostle Paul is a testimony to that, in his formal rare of life he was unable to stop doing bad things that disadvantage him.
So you cannot stop doing the bad things unless, you drive out the spirit of sin in you. First of all you must be forgiven of your sin. Even apostle Paul realized that he cannot renew himself by himself, that is why he wrote to Titus saying, not by works of righteousness which we have done, but according to his mercy, he saved us by renewing of the holy ghost.
So if you want to stop doing bad things, you have to be renewed and washed through babtism.
In other words we have the mind to do what is good but the nature of sin that is in us will not allow us to do that. This is why some people are struggling with sin today, Some people find it difficult to stop committing sin because of our sinful nature. We do not have the power of our own to stop doing the bad things bcs our spirit is willing but, our flesh is weak.
We have to be regenerated by God.