My advice would be multi faceted.
You need to identify what exactly triggers you to have these desires. Do you find that you get these desires when you've got spare time on your hands? An idle mind is the devil's workshop. You know that homework you're supposed to be doing? Do that when you get the desires, make sure you help yourself and move away from distractions such as mobile devices.
When you get these urges and desires, stop. Think to yourself "Is the relationship with myself and my desires really more important to me than my relationship with Allah (swt)?" This will give you the time needed to collect your thoughts before the desires take over again. When you have the moment of clarity, wherever it is, move yourself into a situation where you cannot proceed with these desires. Upstairs in your room and they come? Move downstairs where people are.
Techniques like these can stop the weaker desires. Sometimes the stronger ones are harder to pass. I found that running helped kill those thoughts. I would run faster than I was comfortable running and try to keep it us as long as possible. By the end of these runs I was so tired and thirsty that my desires were replaced with fatigue and thirst.
You've got methods that physically stop you from accessing porn such as
Freedom program which can physically stop you from accessing these sites. You're human and we are all weak to sin. It is not bad to have assistance to stop yourself from accessing porn when you're weaker than you wish to be.
You can do it, you can overcome these urges. It just takes patience and belief. He is most Merciful and Great. He has plans for you, never forget that. Are you going to disappoint Him?