Abdul-Rahman bin Samura reported,

The Messenger of Allah ﷺ said, "Do not ask for a position of authority, for if you are given it without asking, you will be helped in carrying it out, but if you are given it because you asked, you will be left to handle it on your own. And if you swear an oath, then see that something else is better than it, do what is better and offer expiation for your oath."In another narration, "Then offer expiation for your oath and do what is better."

Azami 7101

Sahih

عن عبد الرحمن بن سمرة قال

قال رسول الله ﷺ: لا تسأل الإمارة، فإنك إن أعطيتها من غير مسألة أعنت عليها، وإن أغطيتها عن مسألة وكلت إليها. وإذا حلفت على يمين، فرأيت غيرها خيرا منها، فأت الذي هو خير، وكفر عن يمينك وفي رواية: فكفر عن يمينك، وائت الذي هو خير

الأعظمي 7101صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Oaths and vows
Chapter
Faith
Section
Exception in oaths
Numbering
Jami al-Kamil 7101 (2nd edition)
Azami 7101