One of the biggest problems you can face as a Fresher at University is other people and dealing with those tricky ones you happen to live with can be difficult.
Start before there are problems
The best way to deal with a bad housemate is to stop them before you even realise they're going to make life hell. When you first enter halls or get a student house, get together as a group and lay down some ground rules on things like buying and sharing food, cleaning up, doing chores and so on. This will hopefully help stop any problems before they even occur.
Try to deal with it
Not every little annoyance is worth getting upset about, if it's just a one-off problem or issue then it come sometimes be easiest to just get over it and move on.
Talk to them
If relationships between you and your flatmate(s) do start to deteriorate, talking should be the first option. In a best case scenario you may find that they are completely unaware of what they are doing and things can be quickly resolved.
Talk to others
Chances are if you're annoyed with a housemate you won't be the only one. Talk to your other house or flat mates and ask them for advice and perhaps consider a group meeting to resolve any issues, just be careful of it coming across as ganging up on someone.
Take action yourself
In some situations you may be able to fix the problem yourself, even if its inconvenient it can make things easier in the short term. For example, if there's a problem with a housemate pinching food, keep it in your room.
But don't plot revenge
Attempting to get back at a bad housemate is rarely the answer and will only end in tears - or worse.
Speak to your University
Most Universities will be well prepared for problems between housemates. They may be able to offer advice on your particular problem or even act as a mediator to help resolve disputes.
If worst comes to the worst, plan - either on your own or with the housemates you do get on with - to get rid, don't put up with it. If you're in halls then your University should be able to rehouse you or the troublesome flat mate if things have become too difficult. It can be harder in private accommodation however and you may have to try to keep things together until your tenancy is up. Sometimes the threat of moving out may be just what it takes for a bad flatmate to think about their actions.