How can you keep yourself from cheating?

He's rude to me when he talks to me at all. I have to threaten to leave to get him to do literally anything. Otherwise he just sits on his phone or the computer. He spends literally hours talking to his gaming friends but doesn't have two words for me that are kind. 
He denies everything I accuse him of, in the same idiotic format: 
"We don't talk" 
"Yes we do. We're talking now."
"You talk to other people more than me." 
"No I don't. I'm talking to you now." 
"You don't help out around the house. This room is a mess, and you don't even care." 
"I didn't do it. YOU'RE the one who left that cup there" (points to the cup Im still drinking out of when the entire room is choked out with his garbage). 
"Why are you here? You're not even attracted to me. You don't say I'm pretty." 
"Yes I am. I think youre pretty. See? I said it just now!" 
So I'm sitting here watching him talk for hours to other people about how great they are. One of them is a guy who was a complete piece of crap to me and then blocked me on Facebook but they're just GREAT friends of his) 
....and I've been going on dating sites literally just to have someone to talk to who is actually attracted to me, instead of feeling like I'm begging for his attention. 
I'm not some attention whore either. When I say he never talks to me, I mean that I tried not talking to him until he talked to me and literally went 3 weeks without talking. And even then all he said to me was "where are my keys?" 
And yet if I talk about leaving he's petrified. When we broke up and I was seeing someone else he actually called the guy and ruined it. My only option is to cheat. 
Or get rid of the computer and break his phone. Then he'd be gone in an instant.