Your friend's advice was the same as mine would be. You still care about him. Nothing wrong with that. Still, contact with him reinforces your realization that he is going in the direction he's going in. It is very sad. It's okay to feel some compassion for him. That doesn't mean you have to join him on his trip to hell. Who knows whether he even has the capacity to live differently? As you heard, his whole mindset is to keep going in a wrong direction. So he's not changing anytime soon. He probably misses you, but he's not going to change to get you back. His priority is to first cling to his substance abuse and all that goes with that. It's good that you are choosing a different direction. For you, there is hope.
Separating from him will not always feel as hard as it does now. You have a process to go through. You'll get there.