The Messenger of Allah ﷺ forbade to make a vow. He said: It has not effect against fate, it is only from the miserly that it is means by which something is extracted. Musaddad said: The Messenger of Allah ﷺ said: A vow does not avert anything (i.e. has no effect against fate).
أَخَذَ رَسُولُ اللَّهِ ﷺ يَنْهَى عَنِ النَّذْرِ ثُمَّ اتَّفَقَا وَيَقُولُ لاَ يَرُدُّ شَيْئًا وَإِنَّمَا يُسْتَخْرَجُ بِهِ مِنَ الْبَخِيلِ قَالَ مُسَدَّدٌ قَالَ رَسُولُ اللَّهِ ﷺ النَّذْرُ لاَ يَرُدُّ شَيْئًا