If a person forgets that something is impure and his wet body or clothing touches it, and while he is in the state of forgetfulness he performs prayers with it and remembers it after prayers, his prayers are valid.
However, if his wet body touches an impure object that he had forgotten was impure, and without washing himself he performs ritual bathing (ghusl) and prayers, his ghusl and prayers are invalid unless by performing ghusl his body also becomes pure and the water does not become impure, like when ghusl is performed in running water.
Furthermore, if a wet part of the body on which wuḍūʾ is performed touches an impure object that he had forgotten was impure, and before washing it he performs wuḍūʾ and prayers, his wuḍūʾ and prayer are invalid unless by performing wuḍūʾ the impure part on which wuḍūʾ is performed also becomes pure and the water does not become impure, like when wuḍūʾ is performed with kurr[1] or running water.
Ruling 799.* If someone possesses only one piece of clothing and his body and clothing become impure, and the water in his possession is enough to wash only one of them, the obligatory precaution is to wash the body and perform prayers with the impure clothing. And based on obligatory precaution, it is not permitted to wash the clothing and perform prayers with an impure body.
However, in case the impurity on his clothing is more than what is on his body, or there is an impurity on his clothing that has an additional prohibitive element, such as the blood of a predatory animal,[2] then in such a case, he has the choice of washing whichever one he wants.