How do payments on account work?
HMRC assumes next year will look like this year. So once your Self Assessment bill is known, it asks for half of it again on 31 January and half on 31 July, as a deposit against the year you are already trading through. When that year's return is filed, the deposits come off the bill and you pay, or are refunded, the difference.
They apply only when the bill is above a modest threshold and most of your tax was not already collected at source through PAYE. The current figures are on gov.uk.
The effect is that your first January as a sole trader can cost one and a half years of tax at once — the year just finished, plus half of the year ahead. It is the single most common cash shock in the first year of self-employment.