Remember that your brain has learned a routine, this day, this hour, you mind would think of that(porn), do that(masturbation).
By doing NoFap, you are changing that routine, telling your brain to change its mind path.
And if you do it consistently, reminding yourself that, then it will change its focus every time an urge arises. That will help you to create a new routine, resulting in the end to remove and forget about this addiction.
The hard part of that is dealing with your emotions, as the thoughts come so does the emotions and therefore you must be strong enough to identify them, to know that they are caused by false actions, actions that lead you being miserable and many more, so remove them and don’t look back.