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:2:226

For those who swear not to have sexual relations with their wives is a waiting time of four months, but if they return ˹to normal relations˺ - then indeed, Allah is Forgiving and Merciful.  

For those who forswear their women, by swearing that they will not have sexual intercourse with them, a wait of four months; if they revert, back from the oath, or repeal it and resume sexual relations, God is Forgiving, of the harm they caused their women by swearing, Merciful, to them.
القرآن:٢:٢٢٦

لِلَّذِينَ يُؤْلُونَ مِنْ نِسَائِهِمْ تَرَبُّصُ أَرْبَعَةِ أَشْهُرٍ ۖ فَإِنْ فَاءُوا فَإِنَّ اللَّهَ غَفُورٌ رَحِيمٌ  

{للذين يؤلون من نسائهم} أي يحلفون أن لا يجامعوهن {تربص} انتظار {أربعة أشهر فإن فاءُوا} رجعوا فيها أو بعدها عن اليمين إلى الوطء {فإن الله غفور} لهم ما أتوه من ضرر المرأة بالحلف {رحيم} بهم.