I need advice pls help me

My guy best friend he's amazing and I love him so much. But... Hes a bad choice for me. He hurts me emotionally. He doesn't even mean to but he does. I need to break off our friendship. But I don't want to let him get out of my life. What do I do? He's an unhealthy choice but I don't want him out of my life