The whole matter and actions depend on ones thinking. So thinking about any bad habit may lead you to perform it practically in near future. Now the question arises, how thinking get involved in bad habits. So the answer to this question is the environment and company of a person.
For example, a man is addicted to drugs. The most probable reason might be in this way.
Bad company or environment and Depression may lead to bad thinking and which leads to bad habits like addiction to drugs and so on
thank you