It's pretty simple…I'm someone who values honor a lot. I set a goal for myself and vowed/swore on [insert something or someone very dear to you and whom you'd never want to hurt] their name to not relapse or give in. I tricked myself to honor my own vow or I would tarnish their name. In my case my grandparents and ancestors. I would think they would look down on me in shame if I failed.
Maybe you find this stupid or old fashioned but I'm currently on a 4 minth nofap/noporn streak.