Aslam

Surah Yusuf — 12:26
قَالَ هِيَ رَٰوَدَتۡنِي عَن نَّفۡسِيۚ وَشَهِدَ شَاهِدٞ مِّنۡ أَهۡلِهَآ إِن كَانَ قَمِيصُهُۥ قُدَّ مِن قُبُلٖ فَصَدَقَتۡ وَهُوَ مِنَ ٱلۡكَٰذِبِينَ
Joseph responded, “It was she who tried to seduce me.” And a witness from her own family testified: “If his shirt is torn from the front, then she has told the truth and he is a liar.

Commentary

Joseph (peace be upon him) said: It was she who tried to get me to commit an indecent act. I did not intend it from her. Allah then made a child from her family speak in the cradle and it testified saying: If Joseph’s shirt is torn from the front, then it indicates that she is truthful, because she was trying to stop him from coming on to her; and then he will be lying.

Read Tafsir Ibn Kathir