Is it Haraam to have a wet dream? What can I do to prevent that it happens?
All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
If the questioner is asking whether or not it is forbidden to have a wet dream while asleep, then the answer is no because the sperm comes out unintentionally. Allaah says (interpretation of meaning): {Allaah burdens not a person beyond his scope.}[2:286]. We do not know any means to get rid of wet dreams, however, when a person wants to sleep, he should prepare himself for it: for instance, he should recite the remembrance of the Qur'aan regarding going to sleep and should eat only a little food before sleeping.
Allaah knows best.
You can search for fatwa through many choices