I come into this conversation with the experience of having lived with 10 roommates over the span of my life so this might be interesting/useful to someone thinking about a roommate. Ultimately, it's an individual decision, but my approach always has been to live with someone I find easy going who I don't really consider as a best friend. It saves a decent amount of money over this span (undergrad-fellowship) to have a roommate and I personally like the ability to walk out of my room and encounter another human. If you're not sure how you'll do, you're better off picking the safer option and living alone because most times the sanity will be worth the cost and transitioning mid-year could be chaotic and you can always change your mind between years.
The quality of my roommates has varied, but I have always picked someone in the medicine going through the same cycles as me so they're chill about a few dishes piling up because they understand what the study-exam cycle or working 6 days a week is like.
If you choose to live with a roommate I'd recommend:
-Finding someone in your class/program or someone who's going through the same cycles as you (study, exams, fun, repeat)
-Getting a 2bed-2bath arrangement to minimize common space and because two people keep bathrooms differently.
-Having some mutual agreements on guests. If you like studying quietly, watch out for those sneaky ones who seem quiet but host weekly board game parties with EtOH (Big Bang Theory mimickers). Not judging that lifestyle, just saying it can get loud.
-Having some common sense agreements on common area cleanliness.
-Trying to keep rules to a minimum (ex. avoid rules like: I take trash out this odd weeks, you do it on that even weeks) and be more flexible/forgiving about cleaning up when you get a chance and 10 times out of 10 (at least in my case), your roommate will take a mental note and return the favor. Things get busy, seasons change, moods change, habits fluctuate. The last thing you need is a passive aggressive sticky note from someone reminding you to do something. If for example, you're the type of person who is bothered if someone puts things on your side of the fridge or steals a random snack here and there (or if hearing flatulence is irksome as state above), you're probably better off living alone.
-Limiting codependency (ex. I shop this week, you shop that week) for the same reason as above. Buy your own ****. If you don't want your $3 protein bars eaten, put them in your room.
Above is just one way to do it. Others have roommed with people intending to be BFFLs and I have seen bimodal results (i.e. those who now are getting married with their roommates as a maid of honor vs. those who moved after a semester and don't want to talk about it).