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).