Kinkly explains Cleaning the Pipes

Cleaning the pipes is a way of allowing oneself to think clearly while not allowing sexual desires effect how one thinks. The idea is that cleaning the pipes of this sexual desire will allow the individual to think more clearly. This is why it is a common practice to clean the pipes before going on an important date. The phrase is, generally, used most to refer to male masturbation, but can also be used in reference to women.