It depends on what kind of passport and citizenship you hold. If you’re from one of the countries which are on a visa-free entry agreement with the UK, there’s no need to apply for a visa to enter the UK.
However, if you’re not from those exempted countries, you’ll need to apply for a Standard Visitor visa online or other types of Standard Visitor visas including the long-term Standard Visitor visa, a Visitor in Transit visa and Long-term work visas. A Standard Visitor visa costs £100 for up to 6 months and you’ll be able to apply for it 3 months prior to your departure date.