The Messenger of Allah ﷺ said, "Do not make vows, for a vow does not avert anything from what has been decreed. It is only a means by which something is extracted from the miser."
حدثنا قتيبة حدثنا عبد العزيز بن محمد عن العلاء بن عبد الرحمن عن أبيه
قال رسول الله ﷺ لا تنذروا فإن النذر لا يغني من القدر شيئا وإنما يستخرج به من البخيل
Muslim also narrated it in the chapter on the prohibition of vows, and that they do not change anything, hadith no. 1640, from Qutayba with the same chain.On this topic there is also a narration from Ibn Umar [Bukhari, no. 6608, and Muslim, no. 1639].