Abu Hurairah (RA) reported Allah's Messenger (ﷺ) as saying: He who took an oath and then found another thing better than (this) should expiate for the oath (broken) by him and do (the better thing).
Hadith ReferenceSahih Muslim / The Book of Oaths / Hadith: 1650