Language:
كتاب المناقب
61  
Virtues and Merits of the Prophet (pbuh) and his Companions
(25)
Chapter: The signs of Prophethood in Islam
(25)
باب عَلاَمَاتِ النُّبُوَّةِ فِي الإِسْلاَمِ
Sahih al-Bukhari 3603

Narrated Ibn Mas`ud:

The Prophet (ﷺ) said, "Soon others will be preferred to you, and there will be things which you will not like." The companions of the Prophet (ﷺ) asked, "O Allah's Messenger (ﷺ)! What do you order us to do (in this case)? " He said, "(I order you) to give the rights that are on you and to ask your rights from Allah."

حَدَّثَنَا مُحَمَّدُ بْنُ كَثِيرٍ، أَخْبَرَنَا سُفْيَانُ، عَنِ الأَعْمَشِ، عَنْ زَيْدِ بْنِ وَهْبٍ، عَنِ ابْنِ مَسْعُودٍ، عَنِ النَّبِيِّ صلى الله عليه وسلم قَالَ ‏"‏ سَتَكُونُ أَثَرَةٌ وَأُمُورٌ تُنْكِرُونَهَا ‏"‏‏.‏ قَالُوا يَا رَسُولَ اللَّهِ فَمَا تَأْمُرُنَا قَالَ ‏"‏ تُؤَدُّونَ الْحَقَّ الَّذِي عَلَيْكُمْ، وَتَسْأَلُونَ اللَّهَ الَّذِي لَكُمْ ‏"‏‏.‏
Reference : Sahih al-Bukhari 3603
In-book reference : Book 61, Hadith 110
USC-MSA web (English) reference : Vol. 4, Book 56, Hadith 800
  (deprecated numbering scheme)