The Author of Think and Grow Rich, Napoleon Hill said something along the lines of - Transmutation of sexual urges into productive energy is a key to success. Essentially, when the thought pops into your head, practice refocusing that energy onto a goal and not the urge.