The Ruling on Prohibiting Something by the Heart Without Uttering it, With the Intention of Preventing it
Question :
I am a person who smoke and I said in my heart: If I smoke again, my wife will be forbidden to me. And I forgot and then smoked and then I remembered that I had said that my wife would be forbidden to me. What is incumbent upon me in this situation?
Answer:
Since you are very serious about giving up smoking, I ask Allah, Most Glorified, Most High to help you in giving it up and to bless you with a sincere determination, perseverance and patience so that you are successful in attaining that which you desire.
As for your question about declaring your wife forbidden, if you said it in your heart without pronouncing it, then there is no ruling for it, nor is there any effect from it. If you uttered it, and you meant to reinforce yourself that you should give up smoking, then the ruling of that is the ruling of an oath. If you deliberately smoked while remembering your oath, then you must make atonement for a broken oath. But if you forgot, there is nothing incumbent upon you. But, do not return to it after that when you are mindful of your oath, because if you do so, you will be obliged to make an atonement, I mean the atonement for an oath, which is to feed ten poor persons or clothe them, or to free a slave.
You may choose which of these three things to do. As for the method of feeding the poor, it is to provide lunch or dinner for them, or you may give them rice accompanied by meat. Six kilograms is sufficient for all ten of them, whether they are in one house or in a number of houses. And if you do not find any poor people to whom you may give this, then you must fast for three consecutive days.
Source:
Ibn 'Uthaimin
Fatawa Islamiyah, Vol. 6 Pages 392-393