The Prophet ﷺ said, "Do not make vows, for a vow does not avert anything from what is decreed. It only serves to extract something from the miser."
أخبرنا قتيبة قال حدثنا عبد العزيز عن العلاء عن أبيه
أن النبي ﷺ قال لا تنذروا فإن النذر لا يغني من القدر شيئا وإنما يستخرج به من البخيل
Muslim narrated it, in the Book of Vows, chapter on the prohibition of vows and that they do not change anything, hadith no. 1640, from Qutayba through him, and it is also found in Al-Kubra, hadith no. 4747.