Thinking about the people on my course, a combination of:
-being lucky enough to get some funding (my uni had a good funding scheme for this year for the sciences; there's more than one person besides myself on my course who benefited from this-which covered fees and possibly a living costs bursary, dependent on your undergraduate degree mark and household income), but that's pretty rare.
-saving up between undergrad and masters (or during undergrad).
-loans, maxing out overdrafts
-part time jobs
-parents or spouses that can support them
-plus quite a few people live at home and commute which saves significantly on living costs
I luckily got funding from my uni which covered my fees and gave me a £5k bursary. But I was prepared before I found out that I got funding however, to cover most of my fees with my savings (I worked during most of undergrad and spent little), my parents had offered to help with the rest, and I'd have had to keep a part time job alongside my course (which would have been manageable but also horrible during the most insane weeks during my masters course) which would have covered the barest of my living costs provided I'd lived off beans for a year.
So yeah, for most people it's a case of save, borrow, work and live off as little as possible...