بسم الله الرحمن الرحيم
Masturbation is haram. It is mentioned in a hadith that on the Day of Judgment the masturbator shall be raised in a condition that his hand fingers shall be pregnant. All human beings from Adam to the Day of Judgment shall be gathered on the resurrection day and he shall face humiliation in front of them.
In case one has high sexual desires, then he is advised to keep fast. Masturbation does not reduce the sexual desire rather it renders the penis weak and leaves man unfit for marriage. Masturbation causes weakness in the central parts of the body and it affects health to a degree that the patient prefers death on life. You must refrain from it in any condition.
Allah knows Best!
Darul Uloom Deoband