Praise be to Allah.
If a man wakes up and finds some wetness, one of three scenarios must apply:
He knows that it is maniy (semen), by knowing the characteristics of maniy. The fuqaha’ have stated that the smell of wet maniy is like the smell of dough or the spadix of the palm tree, and the smell of dried maniy is like the smell of egg whites. In that case ghusl is required, but it is not essential to wash one’s garment because maniy is taahir (pure) according to the more correct of the two scholarly opinions.
He knows that it is madhiy (prostatic fluid), which case ghusl is not required, but he must wash off whatever has got onto his body and clothes, because madhiy is najis (impure).
He does not know whether it is maniy or madhiy. That is subject to further discussion.
If his sleep was preceded by something that caused the provocation of desire, such as thinking or looking, then the wetness that he found on his garment comes under the ruling on madhiy.
If his sleep was not preceded by something that would cause emission of madhiy, then he should do that which is most on the safe side, and follow the rulings on both maniy and madhiy; so he should do ghusl and wash off whatever has got onto his clothes, and he should do wudoo’ during his ghusl.
It says in Mataalib Ooli al-Nuha (1/162): If the sleeper wakes up and finds wetness on his body or garment or bed, if he is certain that it is maniy he should do ghusl because it is obligatory, even if he does not remember having a wet dream. Al-Muwaffaq said: We do not know of any difference of opinion concerning that. But he need not wash off whatever it got onto, because maniy is taahir.
Maniy may be recognized by its smell, which is like the smell of dough or the smell of the spadix of a palm tree when it is fresh, or the smell of egg whites when they are dry. If he is certain that it is not maniy, he should purify whatever it got onto of his body or clothes, because it is najis.
If he is confused about this wetness and does not know whether it is maniy or madhiy, if his sleep was preceded by some cause such as cold, looking or thinking or foreplay or an erection, he should purify whatever it has got onto, because it is more likely to be madhiy due to the causes; what we think is likely should be taken as a certainty in this case, such as if he saw a dream in his sleep then he must do ghusl, because it is more likely that it was maniy because of the reason.
But if his sleep was preceded by a cause, and he found some wetness on his clothes or body or bed, he should do ghusl because it is obligatory and he should do wudoo’ in the right order and also purify whatever it has got onto. It says in Sharh al-Iqnaa’: To be on the safe side. Then he said: This is not obligatory on the basis of doubt, rather it is on the basis of taking precautions, because in the case mentioned above, it is either maniy or madhiy and there is no reason to regard one as more likely than the other, therefore to be on the safe side what may be obligatory should be done and that cannot be done except in the way mentioned. End quote.
See also the answer to question no. 22705.
What you have mentioned about advice having to do with prayer, purification and forming relationships with women may be found in the appropriate place on this website. See the answer to question no. 22309.
We ask Allaah to help and guide us and you.
And Allaah knows best.