Taking into account the phenomenon described by Gresham’s Law, one could say that the best way to prevent the establishment of weak or destructive mental models is to put into place checkpoints on your own behaviour. Employ a personal check-and-balance system to identify immediately bad practices and then recognize them for what they really are.
They might benefit you in the short-term, but over time, continuing such bad practices could physically, emotionally, or mentally corrupt you.
In the event that the bad practice has already been ingrained in your system, the best way to handle such cases is to remove yourself from a permitting environment. Look for a more controlling environment that could keep you in line despite the urge to succumb to your impulses.
Without the chance to experience the supposed benefits of the bad practice, you would eventually realize that the negative effects of doing so overpowers whatever advantage you gain from it. Over time, the lack of opportunity to practice would also allow you to phase it out of your system and hopefully replace it with better and more ethical behaviours.