عن عَبْد الرَّحْمَنِ بْن سَمُرَةَ رضي الله عنه أن رسول الله صلى الله عليه وسلم قال له: «يا عبد الرحمن بن سَمُرَة، لا تَسْأَلِ الإِمَارَةَ؛ فإنك إن أُعْطِيتَها عن مَسْأَلَةٍ وُكِلْتَ إليها، وإن أُعْطِيتَهَا عن غير مَسْأَلَةٍ أُعِنْتَ عليها، وإذا حَلَفْتَ على يمينٍ فرأيتَ غيرها خيرًا منها، فَكَفِّرْ عن يمينك، وَأْتِ الذي هو خير».
The Messenger of Allah (may Allah's peace and blessings be upon him) forbade Muslims from seeking authority because whoever is granted authority based on his request will be let down and left to his desire for this world, which he prefers to the Hereafter. On the other hand, whoever is granted authority without seeking or asking for it, Allah shall grant him support to fulfill his duties. Moreover, making an oath should not prevent goodness.
So, if the one who made an oath realized that goodness lies in something different from his oath, he should discard that oath through expiation and go for the better alternative.
Download for free and never miss a prayer again