Narrated from Umm al-Mu'mineen Sayyida Aisha (may Allah be pleased with her): A man said to the Messenger of Allah (ﷺ) while he was standing at the door and I was listening, "O Messenger of Allah (ﷺ)! I wake up in a state of janabah (major ritual impurity) while intending to fast." The Messenger of Allah (ﷺ) said to him: "I also wake up in a state of janabah while intending to fast, so I perform ghusl (ritual bath) and then fast that day." The man said, "You are not like us; Allah has forgiven your past and future sins." At this, the Messenger of Allah (ﷺ) became angry and then said: "By Allah, I hope that I am the most God-fearing among you and the most knowledgeable of what should be avoided."
Hadith Referenceالسنن المأثورة / باب صيام من أصبح جنبا / 295
Hadith Takhrijسنن ابی داؤد، الصوم، باب فيمن أصبح جنبا في شهر، رقم : 2389 وقال الالباني: صحيح