It's not difficult to leave this habit it is difficult to stop thinking about that fucking sex You masturbate because you can't get a girl. You can't get a girl because you're really shy. You're really shy because you have low self-esteem. You have low self-esteem because you think you're kind of a failure and possibly a pervert. You think you're kind of a failure and possibly a pervert because you masturbate all the time. BREAK THE CYCLE.
You can overcome your shyness but it is going to take practice and work. Practice making small talk with females who look approachable and friendly. Write down 20 affirmations and say them to yourself everyday.