We would advise you first and foremost to give your best at school, whichever career path you chose. It’s also important to learn, particularly for a career in F1, that most often success comes from sustained hard work as opposed to occasional displays of brilliance.
Specifically though I would advise you follow the numerate disciplines for your GCSEs and A-Levels i.e. Maths (essential), Physics, Chemistry, Design & Technology, IT etc. You should eventually aim to do a degree in an engineering discipline i.e. Mechanical, Automotive or Aeronautical. As for choice of university or college, with Cambridge, Imperial, Brunel, Bristol, Loughborough and Southampton being popular high-end choices for F1 hopefuls. When you get to thinking about these decisions, it can help to look at F1 careers sites and see what roles they are currently recruiting for and what experience and qualifications they are looking for in the roles you would like to one day be doing. This can really help you map out your journey to get where you want to be!
It is also important to get practical experience, so try to use your vacations or gap year etc. to get some. This could be paid employment in a garage or workshop or even voluntary labour for a junior race team. When you get to university joining the Formula Student Team is a great way of getting really good hands-on experience, as well as being a lot of fun and meeting likeminded people.