The Prophet (ﷺ) said, "Whoever vowed to be obedient to Allah, must be obedient to Him; and whoever vowed to be disobedient to Allah, should not be disobedient to Him."
Sahih al-Bukhari Book 83, Hadith 77