By debate in the House of Commons and the House of Lords. Laws then have to have 'Royal Assent' (signed by the Queen) but this is only a formality as she has no power to veto the law.
In the UK, there are 1000s of laws created by the government to ensure the country is run in the fairest, best way. Like any country, people do break the law, whether it's a law we know about or not....