By the mercy of Allah, you have taken the first step towards cure. The first step is to realize than one is doing something wrong and that is not approved by Allah. This really kills the hopes of Satan who wishes to bring sins onto believers and wishes that they don't realize their sins. Once you realize that you are doing something wrong then you develope the urge and desire to fix it.
There are many ways to get rid of the addiction of maturbation. The first thing that you should consider is the causes that lead you to masturbation. Is it watching pornography, other women, erotics objects, etc...? Whatever is leading you to masturbate, you should figure out ways to prevent yourself from going to the causes of masturbation. If watching pornography is the reason for masturbation then you should start working on quitting watching pornography. If there is another cause leading you to masturbate then you should start working on preventing yourself from that cause.
If you are not married already, then you should get married to someone who you find attractive and liking as soon as possible. If you are not able to marry at the moment for any reason, or you are married but still have masturbation problem then you should observe voluntary Fasting as many times throughout the month as possible. Fasting will help you control your tempatations.
Most importantly, pray to Allah the Almighty and ask for help and cure. Say to Allah: "O' Allah, I admit that what I am doing is wrong but I can't help so help me get out of this addiction my Lord".
And Allah knows best.
Mufti Ikram ul Haq
Fatwa Center of America