Just my experience but when i'm alone with myself for a long time, that's when i'm most dangerous to myself. I need occasional contact with friends. I go to AA and have made a lot of friends there. When i go to meetings, i need the people there to remind me that i'm an okay person and i'm not alone. If your friends are triggers to you then perhaps it is a wise idea to distance yourself from them. Instead of isolating yourself, how about you look at ading some sober friends to your life?