For a limited company in the UK, you need a number of pieces of legal paperwork which I think you can technically write yourself but may prefer a solicitor to draft them correctly for you, and then you pay £100 to register the company, and you (and any other directors, shareholders or guarantors) capitalise the company yourself.
You are now limited in liability for what the company does, to no more than the capital you put into it.
You then have to supply yearly accounts, may have to register for corporation tax, VAT, register as an employer for paying national insurance, you'll probably need business insurance, etc.
You don't need to use a lawyer to draw up the docs unless you have special requirements: you can use the proforma memorandum (it's auto-filled if you apply online) and adopt the model articles of association.
- https://assets.publishing.service.gov.uk/media/5a7da236e5274...
- https://www.gov.uk/guidance/model-articles-of-association-fo...
If you buy and off the shelf company then you don't need any of that - they supply a pile of stuff (e.g. articles of association) and you don't need a solicitor to be involved.
Edit: And these days you don't even need two people - used to be that you needed two directors or director and company secretary.