How do I make myself pure for namaz and everything else, after sperm discharge during sleep?

Answered according to Hanafi Fiqh by

بسم الله الرحمن الرحيم

(Fatwa: 27/29/N=01/1435)

If you experienced seminal effusion while sleep due to some dream or without it and you found the semen on your body or clothes after you got up then you should perform fardh ghusl (i.e. gargling, rinsing nose with water and pouring water over whole body that not even space equal to one hair is left dry over the body). And if the impurity is smeared over the body then it should be specially removed from the body and then wear pure clothes or remove the impurity of unclean cloth and wear it after the impurity is removed. You may offer salah after you do so; nothing else is required from your side.

Allah knows Best!

Darul Ifta,
Darul Uloom Deoband