There are two types of legislation in the UK:
Primary legislation: Acts of Parliament, alternatively called 'statutes'. Acts are assigned a sequential chapter number (c.) within each calendar year.
Secondary legislation (also called delegated legislation): regulations, rules and orders usually made under powers provided by Acts of Parliament. These are known as Statutory Instruments (SI for short). The SIs within each calendar year are given a sequential number.
The UK's Government's official Legislation.gov.uk website provides free access to original and revised versions of legislation. Note that not all types of legislation are fully up to date, and for this reason you should generally prefer the current versions on LexisLibrary. Legislation passed by the devolved national assemblies of Northern Ireland, Scotland and Wales are also included. You'll also find the official explanatory notes to UK and regional Acts on this site.
As a last alternative, the British and Irish Legal Information Institute (BAILII) provides free access to original versions of modern Acts (1988 onwards) and wholly or partially updated versions of older Acts, plus the full-text of SIs from 2002.
For draft legislation, in the form of Bills and Draft Statutory Instruments, see the UK Parliament and Legislation.gov.uk sites respectively.
The European Union's free EUR-Lex legal portal is the principal site for accessing the official text of EU legislative instruments, such as Regulations, Directives and Decisions. EU legislation may also be viewed through the Library's LexisLibrary and Westlaw UK databases. The progress of EU legislative measures is best checked through the Legislative Procedures section of EUR-Lex and the European Parliament's Legislative Observatory service.
LexisLibrary and Westlaw both contain extensive collections of legislation from North America, with variable coverage of Commonwealth and other jurisdictions.
Globally, much is freely available on the Web on official national sites, including:
The World Legal Information Institute (WorldLII) serves as a handy subject portal to such sites and to alternative sources of national legislation for different countries.