With regard to your husband smoking hashish (weed, pot), or consuming other intoxicants or drugs, this requires a great deal of struggle and advice, and seeking help from good and righteous people, so that he can give up this evil habit. If you find that he responds and is sincere, this is what you want, but if you do not get that response from him, then in that case there is no doubt that you have the right to ask for a divorce and to annull your marriage with him.
But in fact dealing with this matter requires looking at various aspects of your life, including your children if you have children, and what will happen to them after this divorce; will you be able to take care of them and look after them, or not? If you do not have children, then the matter is easier.
You mentioned that he prays. If he prays regularly or he prays most of the time, but he does not pray in the mosque, then even though he has done something reprehensible, there is still hope for him so long as he still prays.
But if he does not pray at all, there is nothing good in him for you and such a person does not deserve to have you stay with him.
See the answer to question no. 47335 and 172999.
We advise you to fear Allah, may He be glorified and exalted. Fulfilling the rights of Allah and obeying Him, and fulfilling the husband's rights, are among the most important means of solving marital problems. Moreover you should understand that whatever trials befall an individual in his wealth, his family or his child, may stem from himself in the first place: And whatever of misfortune befalls you, it is because of what your hands have earned [ash-Shoora 42:30]. So we advise you to be patient with your husband whilst continuing to offer sincere advice and praying for him, until Allah sets him straight. Please see the answers to questions no. 9497, 142326 and 32450 for means that will help you to deal with the problems you have mentioned.
If he mends his ways, all well and good; otherwise you can ask for a divorce if you cannot be patient with your husband's annoyances and can no longer carry on living with him, or if you fear for yourself, your religious commitment or your children if you stay with him.
Reproduced from Islam QA