Dear saifulislam.rajib, Don't think and call it bad habit . masturbation
is natural and safe way to release sexual tension
. it doesn't harms your body and not responsible for any post marriage sexual problem . one thing which affects is negative thought about masturbation. most of gays do masturbation hurriedly to release sex. which results in poor orgasmic feeling . as desire is not fully satisfied then there comes the urge to do it again and again. plan your masturbation when you are fully relaxed. try to prolong the session do try to delay your ejaculations many times then finally release it. you find this way more full filling experience and do not develop to repeat it. frequently in this way you can have control over it and rest of your anxiety
will be reduced.