Bismillah
Thank you for your question. The cycle of porn and masturbation is a very difficult one to break, but at the same time it is a cycle that breaks masculinity. As such the first step is to really get to grips with why both porn and masturbation are bad for you and why they are such destructive habits that if not changed may rob you of a happy sex life in the future. The momentary guilt is not usually enough to break the cycle as the excitement after that guilt has passed will push you to repeat. As for porn the first step is to cut all access to porn and to put yourself in positions where you cannot really look at it, such as leaving your room door open, or facing your laptop such that family members walking by could see what is on the screen. And any other tactic that you can use to cut it out. For relapses you need consequences and to carry out those consequences. Such as a 10k run straight after. Some take a freezing cold shower every time they are about to consciously masterbate. These methods are hard but effective in really changing your psychology such that masturbation and porn are no longer attractive and you will think twice before doing them. But the key in kicking these habits is your determination. Do it for yourself and know that at the end what waits for you is your success in both worlds, your becoming in control of your destiny, your self respect and the respect of all those who know what its like to give up a destructive habit.
May Allah make you successful