Don't worry that you didn't know them personally. Most lecturers are well used to giving references to students they didn't know/remember/barely spoke to.
Just pick a module you did well in, email the lecturer explaining that you took their module in x in year y achieving a result of z and would they now be be willing to provide a letter of reference to assist in your application to do an MA. Keep it simple, a few sentences. If they agree they may ask for a CV and for details on the course - be clear, tell them what you want/need, don't waste their time.
Don't leave it too late - lecturers get a lot of emails and some aren't very good at answering them and can be very busy. It took me over 2 months to get two references. I'd suggest you request it from more than one so you have a backup. And if you don't get an answer wait a few weeks and email them again asking if they have had time to consider your request.