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:38:22

When they entered upon David and he was alarmed by them? They said, "Fear not. ˹We are˺ two adversaries, one of whom has wronged the other, so judge between us with truth and do not exceed ˹it˺ and guide us to the sound path.  

When they entered upon David, and he was frightened by them. And they said, ‘Do not fear; we are, two disputants (some say that this means ‘two groups’, in order to agree with the plural person ˹of the verb dakhalū, ‘they entered’˺; others say, ‘two individuals’ with the plural person actually denoting these two; alkhasm may refer to a one or more individuals. These two were angels who had come in the form of two disputants, between whom there ˹was supposed to have˺ occurred the situation mentioned — ˹but˺ only hypothetically — in order to alert David, peace be upon him, to what he had done: he had ninety nine women but desired the woman of a man who had only her and no other. He ˹David˺ had married her and consummated the marriage. One of us has infringed upon the ˹rights of the˺ other, so judge justly between us and do not transgress, ˹do not˺ be unjust, and guide us, direct us, to the right path’, the correct way.
القرآن:٣٨:٢٢

إِذْ دَخَلُوا عَلَىٰ دَاوُودَ فَفَزِعَ مِنْهُمْ ۖ قَالُوا لَا تَخَفْ ۖ خَصْمَانِ بَغَىٰ بَعْضُنَا عَلَىٰ بَعْضٍ فَاحْكُمْ بَيْنَنَا بِالْحَقِّ وَلَا تُشْطِطْ وَاهْدِنَا إِلَىٰ سَوَاءِ الصِّرَاطِ  

{إذ دخلوا على داود ففزع منهم قالوا لا تخف} نحن {خصمان} قيل فريقان ليطابق ما قبله من ضمير الجمع، وقيل اثنان والضمير بمعناهما، والخصم يطلق على الواحد وأكثر، وهما ملكان جاءا في صورة خصمين وقع لهما ما ذكر على سبيل الغرض لتنبيه داود عليه السلام على ما وقع منه وكان له تسع وتسعون امرأة وطلب امرأة شخص ليس له غيرها وتزوجها ودخل بها {بغى بعضنا على بعض فاحكم بيننا بالحق ولا تشطط} تَجُرْ {واهدنا} أرشدنا {إلى سواء الصراط} وسط الطريق الصواب.