Abu Hurairah (May Allah be pleased with him) said:
The Messenger of Allah (ﷺ) said, "When you swear an oath and consider something else to be better than it, make expiation for your oath and do the thing that is better."[Muslim].
App reference: Book 18, Hadith 206
Arabic/English book reference: Book 18, Hadith 1716