If you are still at a point in life where you are struggling with cravings/getting clean for good, please take it from me: you have to cut out any people who are using around you. If they are using drugs you don't have a problem with, like if you aren't bothered by someone having a glass of wine with dinner, or with someone else who just smokes cannabis, these are OK friends to have.
If you have a problem with using heroin and other opiates, don't have any friends in your life who are recreational opiate users. It is not going to benefit you.
Yet others are going to have a problem with people who are using any drugs if they have to give up their drug of choice. If you're one of these people, don't have friends who use drugs, which might be even harder to accomplish given how many people are taking medicine these days, but it's not impossible.
Some people may stop talking to you because you're a drug user, and that may be because they don't want to relapse themselves, or maybe they just have an incorrect attitude/belief of drug users. Nonetheless, I wouldn't take it personally.