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:66:1In the name of Allah, the Entirely Merciful, the Especially Merciful.

O Prophet, why do you prohibit ˹yourself from˺ what Allah has made lawful for you, seeking the approval of your wives? And Allah is Forgiving and Merciful.  

O Prophet! Why do you prohibit what God has made lawful for you, in terms of your Coptic handmaiden Māriya — when he lay with her in the house of Hafsa, who had been away, but who upon returning ˹and finding out˺ became upset by the fact that this had taken place in her own house and on her own bed — by saying, ‘She is unlawful for me!’, seeking, by making her unlawful ˹for you˺, to please your wives? And God is Forgiving, Merciful, having forgiven you this prohibition.
القرآن:٦٦:١بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ

يَا أَيُّهَا النَّبِيُّ لِمَ تُحَرِّمُ مَا أَحَلَّ اللَّهُ لَكَ ۖ تَبْتَغِي مَرْضَاتَ أَزْوَاجِكَ ۚ وَاللَّهُ غَفُورٌ رَحِيمٌ  

{يا أيها النبي لم تحرم ما أحل الله لك} من أمَتِكَ مارية القبطية لما واقعها في بيت حفصة وكانت غائبة فجاءت وشق عليها كون ذلك في بيتها وعلى فراشها حيث قلت: هي حرام عليَّ {تبتغي} بتحريمها {مرضات أزواجك} أي رضاهن {والله غفور رحيم} غفر لك هذا التحريم.