Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:58:3

And those who pronounce thihar from their wives and then ˹wish to˺ go back on what they said - then ˹there must be˺ the freeing of a slave before they touch one another. That is what you are admonished thereby; and Allah is Acquainted with what you do.  

And those who repudiate their wives by zihār and then go back on what they have said, instead doing the opposite of this and retaining the woman divorced by zihār, that which is contrary to the purpose of zihār in which a woman is characterised as being forbidden — then ˹the penalty for them is˺ the setting free of a slave, an obligation upon him, before they touch one another, in sexual intercourse. By this you are being admonished; and God is Aware of what you do.
القرآن:٥٨:٣

وَالَّذِينَ يُظَاهِرُونَ مِنْ نِسَائِهِمْ ثُمَّ يَعُودُونَ لِمَا قَالُوا فَتَحْرِيرُ رَقَبَةٍ مِنْ قَبْلِ أَنْ يَتَمَاسَّا ۚ ذَٰلِكُمْ تُوعَظُونَ بِهِ ۚ وَاللَّهُ بِمَا تَعْمَلُونَ خَبِيرٌ  

{والذين يظاهرون من نسائهم ثم يعودوا لما قالوا} أي فيه بأن يخالفوه بإمساك المظاهر منها الذي هو خلاف مقصود الظهار من وصف المرأة بالتحريم {فتحرير رقبة} أي إعتاقها عليه {من قبل أن يتماسا} بالوطء {ذلكم توعظون به والله بما تعملون خبير}.