The habit loop: cue (trigger) > routine > reward.<p>You can't easily change the cue and reward, but you can change the routine.<p>Cues can be really tricky. Something like pornography is rarely triggered by horniness. It's often things like fatigue, stress, being alone in a room, seeing someone in a certain type of clothing.<p>Reward can also be very tricky. For pornography, it's often an orgasm. For gambling, it's winning money. It's not easy to replace these rewards with say, a game.<p>What you can do is change the routine easily. For example, someone triggered to look at porn might instead look for his wife. Someone triggered to gamble could trade stocks or cryptocurrency instead.<p>There's also always been a "boredom" black hole that has been displaced by newspaper, TV, IRC, Netflix, forums, Facebook, Reddit and so on. These things run on the same cue/routine and are easy to displace.