Sahl bin Saad reported,

A man came to the Messenger of Allah ﷺ and said, "Messenger of Allah, what is your view about a man who finds another man with his wife? Should he kill him, in which case you would put him to death, or what should he do?"Then Allah revealed concerning them what is mentioned in the Quran about the mutual cursing. The Messenger of Allah ﷺ said to him, "A judgment has been issued concerning you and your wife."So they performed the mutual cursing while I was present with the Messenger of Allah ﷺ, and he separated her from him. It then became established practice to separate the Mutalaineen. She was pregnant at the time, and he denied her pregnancy, so her son was attributed to her. The established practice in inheritance then became that he would inherit from her and she would inherit from him whatever Allah has prescribed for her.

Bukhari 4746

Sahih

حدثني سليمان بن داود أبو الربيع حدثنا فليح عن الزهري

عن سهل بن سعد

أن رجلا أتى رسول الله ﷺ فقال يا رسول الله أرأيت رجلا رأى مع امرأته رجلا أيقتله فتقتلونه أم كيف يفعل فأنزل الله فيهما ما ذكر في القرآن من التلاعن فقال له رسول الله ﷺ قد قضي فيك وفي امرأتك قال فتلاعنا وأنا شاهد عند رسول الله ﷺ ففارقها فكانت سنة أن يفرق بين المتلاعنين وكانت حاملا فأنكر حملها وكان ابنها يدعى إليها ثم جرت السنة في الميراث أن يرثها وترث منه ما فرض الله لها

البخاري 4746صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Tafsir
Chapter
Fifth, that the curse of Allah be upon him if he is among the liars
Numbering
Darussalam 4746
Bukhari 4746