'Abdur-Rahman bin Samurah (May Allah be pleased with him) reported:
The Messenger of Allah (ﷺ) said to me, "Do not ask for position of authority. If you are granted this position without asking for it, you will be helped (by Allah) in discharging its responsibilities; but if you are given it as a result of your request, you will be left alone as its captive. If you take an oath to do something and then find a better alternative, you should adopt the latter and expiate for your oath."[Al-Bukhari and Muslim].
Arabic/English book reference: Book 1, Hadith 674