[Machine] The Messenger of Allah ﷺ used to go out for prayer with drops falling from his head while he was in a state of sexual impurity. So, he would perform ritual ablution (ghusl) while intending to fast.
لَقَدْ كَانَ رَسُولُ اللهِ ﷺ «يَخْرُجُ إِلَى الصَّلَاةِ وَرَأْسُهُ يَقْطُرُ كَانَ جُنُبًا فَاغْتَسَلَ وَهُوَ يُرِيدُ الصَّوْمَ»