I'm not sure you can ever be sure. People I've known for years have still suprised me- usually in a bad way. Even family members. I came to the horrible conclusion years back that you could only truly rely on yourself. If people are supportive then great- enjoy it in the moment. Just don't be lulled into relying on it always.
I find that now, I pull myself back. So- I might perhaps arrange to do something say, (although, that hasn't happened in years!) but, I'll remind myself not to set my heart on it. It will be nice if it happens but, it won't surprise me if it doesn't. That goes for work too. So many projects don't get off the ground.
I also had to recognise in myself that I was wanting too much from a friend (in an emotionally needy way, rather than romantic.) I think it's important to try to work out what you both want from the relationship and, how much they're willing to give. Being vulnerable and needy was great when those needs were being met but in a weird way, that sort of encouraged me to want more, which was a dodgy place to be because it got to a point where they couldn't fulfil those needs. Their proritize switched to their partner and later, their family. Before then though, I worked out I needed to let go. I think in many ways, I'm better off isolating. I eventually managed to work out how to stabalize myself after a whole bunch of introspection.
I don't think I have BPD by the way but, I am prone to limerence and I do feel an intense need, even in friendships.
As for people who aren't good for you. I guess you need to maybe identify what kind of person they are. Do they seem to have common traits? Exploitation, manipulation? Maybe you need to look for the red flags from the outset. I'm not great at judging people either. Since keeping most at an arms length though, it's become less impactful if things flop. Not the best way to live though.