Kindly refer to the following link(s):
Is it permissible to make Vows (Nadhr)? | Sheikh Assim Al Hakeem
https://www.assimalhakeem.net/is-this-permissible-to-ask-for-something-dua-and-saying-tha-if-i-got-what-i-asked-for-i-will-offer-10-nawafil-or-do-fast-for-a-day-or-two/
https://www.assimalhakeem.net/is-vowing-to-allah-haram-example-like-vowing-to-allah-that-if-allah-full-fill-this-dua-for-i-will-fast-a-day-for-him-in-return/
https://www.assimalhakeem.net/if-a-person-says-oh-allah-if-you-make-something-happen-i-will-pray-fajr-everyday-fajr-prayer-is-something-allah-enjoined-us-so-is-this-vow-invalid-no-kaffara-needed-if-he-doesnt-pray/