If you can control your gaze, you will have less lustful thoughts, thereby making it easier to avoid pornography and masturbation. Avert your eyes whenever there is a temptation. You might be watching football on your TV, when all of a sudden a cheerleader appears on the screen. Look away for a few seconds and you'll be successful in avoiding that temptation. If you're at a mall and you happen to be walking past Victoria's Secret, don't go in there and don't look at the ads therein. If you happen to be at a gym, you know that there will be women working out who are wearing revealing yoga pants and tight tops. Don't look at them.
If you can make progress in this area of your life, you will find it easier to avoid lust and therefore it will make you masturbate less.