Communication is key when you are going to be living in close quarters with someone you don't know. Do these things for a happier living situation!
1. Communicate before moving in to coordinate who will have what items, what can be shared/what cannot etc. If you are living in a dorm room or small apartment this is crucial!
2. Upon arrival be friendly and open to each other. Have an honest conversation about expectations about things like cleanliness, keeping doors locked, being quiet after a certain hour, friends in the room/apartment, borrowing each others belongings etc.
3. Be honest about your pet peeves with that person. If they don't know about them they can't avoid doing them!
4. Do things with your roommate so that you get to know each other. Eat meals together, go to the gym, etc. Simple things make a big difference! It is awkward to live with someone you don't speak to.