You can find out information on the requirements for Visitor visa for study purposes on the UK government website as well as information on how to apply for a visitor visa.
Some nationals do not need to apply for a visa prior to travelling if they are coming to the UK as a visitor for less than 6 months.
If you are non-visa national (any national who is not on the visa national list) then you can apply for leave to enter as a visitor on arrival at the airport. You will still need to meet the requirements and have the evidences as outlined below.
See also: Do I need entry clearance?
If you are a national of an EU country, Australia, Canada, Iceland, Japan, Liechtenstein, New Zealand, Norway, Singapore, South Korea, Switzerland or the USA you will also usually be able to use the E-gates when you enter the UK. This means you will not receive a stamp in your passport to show when you entered the UK and if travelling as a visitor, you will be automatically given 6 months permission to enter the UK. It is important you keep evidence of the date you entered the UK, as the university will need this as proof of when your permission to enter expires.
If you are a visa national you will need to apply for your Visitor visa before travelling to the UK. You do not need to do this from your country of nationality or residence; you can apply from any country where you are lawfully present.
Electronic Visa Waivers
You can get an electronic visa waiver (EVW) instead of a visitor visa if you are a national of Kuwait, Oman, Qatar or the United Arab Emirates.
If you are a national of Bahrain or Saudi Arabia, you can apply for an EVW from 1 June 2022.
See: Electronic Visa Waiver information (gov.uk).