You should try to keep yourself within the company of good people and similar minded people as that will stop any kind of desire or temptation for doing bad things as would be the case if you kept yourself in the company of non religious people. More time spent in religious activity will keep the mind strong and the soul clean.