The rules sit in Part 23 of the Companies Act 2006. Section 830 allows a distribution only out of profits available for the purpose: accumulated, realised profits not previously distributed or capitalised, less accumulated, realised losses not previously written off. That figure is not the bank balance, and losses carried forward from earlier years reduce it. Section 836 applies the test by reference to the relevant accounts, normally the last annual accounts circulated to members under section 423. Where those accounts do not show enough profit, the directors may rely on interim accounts, and a company still in its first accounting reference period uses initial accounts; for a private company, sections 838(1) and 839(1) require them to enable a reasonable judgment of profits, losses, assets, liabilities, provisions, capital and reserves. Section 840 adds a point many directors miss: earlier distributions made by reference to the same accounts count against the same profits.
Under section 847, a shareholder who knows or has reasonable grounds for believing that a distribution was unlawful must repay it, and the Court of Appeal held in It's A Wrap (UK) Ltd v Gula [2006] EWCA Civ 544 that knowing the facts is enough; ignorance of the law is no defence. Directors who authorise an unlawful dividend can also be personally liable to the company.
Procedure comes from the articles. Under the Model Articles, article 30(1) lets the directors pay interim dividends, article 7(2) lets a sole director decide alone and article 8 allows a unanimous written resolution. If you are unsure which version your company adopted, compare it with our articles of association template for UK private companies. The paperwork is summarised in the GOV.UK guidance on dividend vouchers and board minutes, which expects minutes even when you are the only director.