Allah sent Muhammad ﷺ with the truth and revealed the Book to him. Among what was revealed to him was the verse of stoning. The Messenger of Allah ﷺ carried out stoning, and we carried it out after him. I fear that, as time passes, someone will say, "We do not find stoning in the Book of Allah," and they will go astray by abandoning an obligation that Allah revealed. Stoning is indeed a binding duty upon anyone who commits adultery while married, provided there is clear evidence, or pregnancy, or a confession.
حدثنا سلمة بن شبيب وإسحق بن منصور والحسن بن علي الخلال وغير واحد قالوا حدثنا عبد الرزاق عن معمر عن الزهري عن عبيد الله بن عبد الله بن عتبة عن ابن عباس
إن الله بعث محمدا ﷺ بالحق وأنزل عليه الكتاب فكان فيما أنزل عليه آية الرجم فرجم رسول الله ﷺ ورجمنا بعده وإني خائف أن يطول بالناس زمان فيقول قائل لا نجد الرجم في كتاب الله فيضلوا بترك فريضة أنزلها الله ألا وإن الرجم حق على من زنى إذا أحصن وقامت البينة أو كان حبل أو اعتراف
Agreed upon by Bukhari and Muslim. Bukhari narrated it in "Holding Fast to the Book and the Sunnah," in the chapter "What the Prophet ﷺ mentioned and urged regarding the agreement of the people of knowledge... etc.," hadith no. 7323, from the hadith of Mamar. Muslim narrated it, hadith no. 1691, from the hadith of Zuhri, through the same chain.