MY EX IS REACHING OUT TO ME? WHAT DO I DO? PLEASE HELP

I was with my ex for 2 years. I was his only source of outlet but we broke up because he was emotionally cheating. Now, he's opening up to me about personal problems about his family because he doesn't have anyone else to open up to. He didn't say he wanted me back or anything. He's simply venting. I want to help him out and give him words of comfort and encouragement, but I'm still so hurt by what he did to me. I want to move on and forget about him but I also still care. I feel like he will tempt me in getting back with him if we have contact again. How do I approach this situation?