We used to practice withdrawal during the time of the Messenger of Allah ﷺ while the Quran was still being revealed.
حدثنا سفيان عن عمرو
كنا نعزل على عهد رسول الله ﷺ والقرآن ينزل
Its chain of transmission is sahih. It is found in Bukhari 9/305, no. 5207, in the Book of Marriage, chapter on coitus interruptus, and in Tahawi's Maani al-Athar 3/35 with similar wording.