Do whatever works for you but I personally tried some depression pills and ADHD drugs that never worked for me in my past. I think all of these drugs can be harmful like porn. For example when I was on Ritalin, it was giving me some dopamine rush like porn especially the first times, I am addicted for years but drugs gave me more sleep related problems and more troubles. And I tried to find some informations about these psychiatric drugs and I found this book:
https://www.amazon.com/Myth-Chemical-Cure-Psychiatric-Treatment/dp/0230574327
This last year has been one of the worst in my life. I've been unemployed and struggling. Most of my life I have been ambitious and hard working. Now, I can't seem to find the energy to try.
I need to practice my programing skills, I need to finish my grad school applications, and I need to keep reaching out to companies and recruiters. I wonder if porn and internet use have turned me into someone who can't focus. I know porn contributes to hypofrontally and that pretty well describes my state of mind. I just can't seem to stay focused one a specific task and drive it to completion.
I can relate mostly with myself. A lot of guys in this forums are just talking about their erectile dysfunctions, their sex related problems, their dick hardness, spontaneous erections etc. But I discovered I have a problem years ago when I had lack of concentration, loss of ambition, starting to see anxiety, beginning to see low grades, self-esteem problems and moreover. We are talking about the 'porn addiction itself' but this is actually an arousal addiction, which gives us a 'dopamine high'. And it reduces it receptors by using porn a lot, years and years and lead to an addiction. When it comes to porn, there is no 'active substance' for it. Do you ever wondered why when we in front of the screen while porn playing we overfocus to it, we lock to it? Because it leads to a dopamine rush.
I am a Math and Computer Science student, too and when I have this 'porn reality', everytime I have a trouble with my memory. With this brain fog I can't focus any task nor I can reach my projects and works. I know, you have to learn a lot in this area and you have to apply something to it. But everytime I had a successful reboot, I have better aspects every area of life. I was on this addiction relapse cycle too many years and I found there is just one way out. Quitting porn forever. With physically, emotionally and mentally. And when you do this, if you do something right, your brain punishes you, I am talking about withdrawals. And it can be suck. Maybe it seems like your concentration was better while using porn. No, your brain feels like it. If you have addiction related brain changes, actually porn created this 'need', this mentality.
I don't know what is your past experience either what is your life look like but you should know you are not alone. All of us here want to take control back. I hope it helps and you can control over your life.