Hey man, ive been there, i know how it feels. Dont loose hope!
There are a couple of methods, that help me to resist the urges.
1) there are two golden rules for me: no touching and no fantasizing. Therefore i sometimes grabed my pillow and didnt allow myself to let go of it.
The fantasizing part is difficult sometimes, especially when you've got motivations issues to do stuff, that gets your mind off of it. But try to focus on other things, by doing or thinking something else.
2) One day i watched the series Dr. House Season 6, Episode 1. In the very first scene Dr. House is withdrawing from opioids and this scene really gave me strength, because i realized, that this fucking porn thing is as bad as hwithdrawals from opioids and that i have to take it dead fucking seriously to overcome it. So when it got or gets really bad ( but after 5 months it is getting much better now), i remember this scene and that its going to be very fucking hard, but that i have to stay strong. So it gives me like a will boost to resist it. Sometimes it will feel like you are dying (because your brain actually thinks, that you need this for your survial), but you really have to be willing to face death, to conquer this.
At the beginning of my recovery i was not able to give up on masturbation. When the urge for porn was to much to bare, i had to mo. But in the beginning it triggered some relapses for me. Also i saw my first improvements, when i was also able to give up on mo. But when the urges and cravings are so powerful, that you feel like you are about to open your laptop, its still better to mo, at best without porn-fanatsy, than to pmo. But try to stay away from it as long as you can.
3) watch out for triggers like nudity in movies or ads. Just immidiately close it and try to do something else. When there is nothing to do or lack of motivation just lay in your bed, grab your pillow and try ro calm down or to sleep.
Against motivation issues or depressions the most reliable strategy for me is trying to envision myself not having ed anymore, and what i would be able to do. The important part is not to envision yourself having sex, which can cause cravings again, but how i would be able to be more confident with girls or peers or my friends. How i would be able to do better at university because i have more energy, hope and motivation. Being motivated to do sports, because i have motivation to be more good looking. Really whatever your goals are.
Try to feel, how it would feel like and also envision that you wouldnt have pied right in the moment. Then i try to go step by step to what i want to do. For example: 1) getting my laptop to the kitchen. 2) turning it on 3) opening the stuff i have to do for my studies and so on...That often helps me to get motivated to do stuff. But not always, so try to not put too much pressure on you. Your motivation and emotional systems are fucked right now and they need time to heal, so try to give it the time, that it needs. You wont most likely not be able to change your life completely from one day to another, but it will get easier with time. Ive got my worst cravings and urges, when i tried to do something and then wasnt able to finish or suceed with it (like writing a paper or to study). Then i really had to allow myself to go to bed to sleep or just to rest, like you would do with an actual illness, the flue or something. Because thats pretty much, whats going on with your body, your stress level and hormons are out of control and you are in fighting mode. So allow yourself then to heal, like you would do, when you are sick.
Relapsing is bad man. The last time i went into a fucking mental breakdown. But remind yourself, what you want out of your life and that you can have that with time and work and then get back on track. You will not start at zero again. Its not like super mario, where you start at the beginning. Every streak counts and every streak makes it easier and helps you to heal. You will find your ways to tackle your issues, problems, and this addiction.
Yo will do it man. It will get better and easier. Stay strong