If you’re employed or get a pension, HMRC will change your tax code so you pay the tax automatically. To decide your tax code, HMRC will estimate how much interest you’ll get in the current year by looking at how much you got the previous year.
If you’re not employed, do not get a pension or do not complete Self Assessment, your bank or building society will tell HMRC how much interest you received at the end of the year. HMRC will tell you if you need to pay tax and how to pay it.
https://www.gov.uk/apply-tax-free-interest-on-savings