Students Confessions

Ive been struggling with porn and masturbation since a very young age. Ive wanted to stop ever since I came to know God but I can't. I pray to hate this sin but it never works. Please help me.