Whenever lust comes, if you are used to masturbating, you instead exercise; it'll help you develop better body and it's good redirection of sexual energy.
I think this has been mentioned on researches about porn addiction too. Exercising helps to reduce energy and improve the connection on our brain tissue iirc, which in turn reduces the rewarding feeling of masturbation. Unfortunately, it isn't as easy as saying if you feel A, do B.
Btw, I tend to use earphones to reduce noise lately because I live near a busy street. Probably not a huge life hack but I find sleeping with a noise cancelling ear phone to be quite good if you can find one that suits your ear.