All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and messenger.
The scholars differed in opinion about making a vow, whether it is permissible or disliked. However, they all agreed that it is an obligation to fulfill it if it occurs as the Prophet said: “Whoever has made a vow to obey Allaah, he should obey Him, and whoever has made a vow to disobey Allaah, he should not disobey Him." [Al-Bukhari]
For more information on the ruling on making a vow, please refer to Fataawa 88336 and 200545.
If a person vows not to eat lawful food, he has made a vow to abandon what is permissible, thus, his vow is not effective according to a group of scholars, because it is not a vow of doing something that makes a person get closer to Allaah [i.e. it is not an act of obedience], but it is not an innovation. Ad-Dusooqi said in his commentary on Mukhtasar Khaleel Al-Maaliki: “A vow is to be fulfilled only when it is intended to do something recommended in Sharee'ah. This means that what should be fulfilled is the vow of doing something which draws the person closer to Allaah." This is based on the statement of the Prophet : “There is no vow except in matters by which one seeks the Pleasure of Allaah.” [Abu Daawood and Ahmad - Al-Albaani graded it as Hasan (good)]
However, some scholars are of the view that regarding a vow about something permissible, the person is given the choice between fulfilling it and expiating for breaking his oath. The expiation for breaking an oath is: freeing a slave, or feeding ten poor people, or clothing them, and if one is unable to do any of the above, then he must fast for three days. For more benefit, kindly refer to Fatwa 83652.
Allaah Knows best.