We have already explained in the answer to question no. 329 that the secret habit is haraam and how to rid oneself of this habit. The Muslim does not have to make promises and vows in order to give up the things that Allaah has forbidden to him. It is sufficient for him to know that it is haraam and that should be enough to make him give it up. If he makes a promise or a vow to Allaah not to do the haraam thing then he goes and does it again, then he has committed the sin of doing something haraam as well as the sin of breaking a promise or going back on an oath or vow.
Allaah has enjoined fulfilling promises, as He says (interpretation of the meaning):
The words “and fulfil (every) covenant” mean – and Allaah knows best – that it is obligatory to fulfil the promises that one makes to Allaah through vows and promises to do acts of worship. Allaah has obliged us to fulfil them, as He says (interpretation of the meaning):
“And of them are some who made a covenant with Allaah (saying): ‘If He bestowed on us of His Bounty, we will verily, give Sadaqah (Zakaah and voluntary charity in Allaah’s Cause) and will be certainly among those who are righteous.’
76. Then when He gave them of His Bounty, they became niggardly [refused to pay the Sadaqah (Zakaah or voluntary charity)], and turned away, averse.
77. So He punished them by putting hypocrisy into their hearts”
Ahkaam al-Qur’aan, 3/299
Fulfilling promises is obligatory. Allaah says (interpretation of the meaning):
“And fulfil the Covenant of Allaah (Bay‘ah: pledge for Islam) when you have covenanted”
And He condemns those who do not do fulfil their promises by saying (interpretation of the meaning):
“And of them are some who made a covenant with Allaah…” [al-Tawbah 9:75].
Whoever makes a promise to Allaah to do something and does not do it, or makes a promise not to do something and does it, then he has committed the sin of breaking that promise, and he has to offer expiation for breaking an oath (kafaarat yameen), because a promise is a kind of oath or vow, and the one who breaks an oath or vow has to offer kafaarat yameen. He is given the choice of freeing a slave, or feeding ten poor persons, or clothing them. Whoever cannot do any of these things has to fast for three days.
Ibn Qudaamah said:
If a person says: I solemnly promise to Allaah that I will do such and such, then this is an oath in which the intention was to swear an oath to Allaah.
Shaykh al-Islam Ibn Taymiyah said:
Promises and vows are verily similar. If a person says: I promise Allaah that I will do Hajj this year, then this is a vow and a promise and an oath. If he says, I will not speak to Zayd, this is an oath and a promise but not a vow. But an oath is a vow when a person promises to an act or worship or an action by means of which he may draw closer to Allaah.
Al-Fataawa al-Kubra, 5/553.
This is also the view of Ibn ‘Abbaas, Maalik, ‘Ata’, al-Zuhri, al-Nakha’i, al-Shu’bi and Yahya ibn Sa’eed, as it says in al-Mudawwanah, 1/579, 580.
In conclusion: You have to offer kafaarat yameen for breaking your promise to Allaah. We ask Allaah to bless you with guidance, piety, chastity and independence of means.
And Allaah knows best.