It is narrated from Sayyiduna al-Miqdad (may Allah be pleased with him) that Sayyiduna Ali (may Allah be pleased with him) instructed him to ask the Prophet (peace and blessings be upon him) about a man who goes near his wife and madhy (pre-seminal fluid) comes out of him: what is required of him? "For his daughter is married to me, and I feel shy to ask him." Al-Miqdad (may Allah be pleased with him) said: So I asked the Messenger of Allah (peace and blessings be upon him) about that, and he (peace and blessings be upon him) said: "When any of you experiences this, let him sprinkle water on his private part, and perform ablution (wudu) like the ablution for prayer."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17730