The Prophet ﷺ forbade making vows, saying, "A vow does not avert anything. It only extracts something from the miser."
نهى النبي ﷺ عن النذر، قال: إنه لا يرد شيئا، وإنما يستخرج به من البخيل.
Bukhari related it in the Book of Divine Decree (6607), and Muslim in the Book of Vows (1639), both from the hadith of Sufyan, from Mansur, from Abdullah bin Mura, from Ibn Umar, who narrated it. The wording given here is Bukhari's, and Muslim referred back to the earlier narration.In another version found in Muslim, "One day the Messenger of Allah ﷺ took to forbidding us from making vows, saying, 'It does not bring anything about, it only extracts something from the miser.'"