I’ve found (after roommates too numerous to count) that it’s not entirely the luck of the draw. Your chances improve substantially if (believe it or not) you
(a) move in with total strangers, ie people who you have no reason to try to get along with, people you have no problem being a hardass too (because hardassery is necessary when you’re living with others), people who you can comfortably tell to thrown out their own feminine hygeine products (ugh) and no, their friend is not welcome to crash on the couch indefinitely, and to pay their bills, or get the fuck out. You’re welcome to move in NEXT DOOR to your friends, or become friends with your roommates, but having a relationship beyond the hardass business of being roommates is inviting trouble.
(b) Put everyone’s name on the lease, get deposits for bills in your name, etc.
It also helps a lot to know your rights as a tenant thoroughly. I’ve had two housemates (different apartments, same landlord) totally illegally evicted by the landlord who took advantage of them. Here, for instance, if your and your roommate’s names are both on the lease, and s/he bails, you cannot be held responsible for their rent.