I’m currently reading a phenomenal book by John Piper, “When I Don’t Desire God.” In it, one of the points brought up is that we must replace desire with desire. So to get rid of bad desires, we must fill them with good, holy desires.
“This is how the truth of God’s Word sets us free. It gives us the weapon with which we kill deceitful desires. Just as Jesus spoke of violence in the battle against desire, so does Paul: “Put to death therefore what is earthly in you . . . evil desire, and covetousness, which is idolatry” (Col. 3:5). And in another place he says, “If by the Spirit you put to death the deeds of the body, you will live” (Rom. 8:13). The fact that one text says put to death desires and another says put to death deeds simply shows that behind evil deeds are evil desires. It would do no good just to kill the deed and leave the desire. That is not the way of Jesus. Jesus’ way is: Put to death the deed by putting to death the desire. Strangle the deed by cutting off its air supply—namely, the deceit that it will bring us lasting joy.”
John Piper, When I Don’t Desire God, pg. 104
I only post an entire paragraph, because you yourself can find the entire book online for free.