You basically only touch yourself when your penis is soft and stop immediately once it starts getting hard. The idea is that your brain will associate it being soft with arousal, and hardness with the lack of it. Over time, your mind will strengthen this association to the point were it will seek to mantain your penis flacid as a way of prolonging your pleasure.
I've heard from people that have done this that it takes about two weeks to be unable to get an erection even if you try a lot. Personally, a few hours after making this thread I managed to cum while almost completely flacid, with the aforementioned time of practice i mentioned in the OP.
I'm not sure it's reversible, so I'm debating wether to continue doing this or not.