Health services are mostly free at the point of need in the UK. UK residents pay taxes that fund the National Health Service (NHS).
You might need to pay a healthcare surcharge (called the 'immigration health surcharge' or IHS) as part of your immigration application. Whether you need to pay depends on the immigration status you're applying for. Visit GOV.UK for more information on the healthcare application.
If your course of study in the UK is less than 6 months then you'll need to consider private health insurance.
Learn more about the Immigration Health Surcharge on the government website.