If you have an EU/EFTA nationality, visa regulations do not apply to you. However, most non-EU/EFTA citizens will need to apply for a student visa. Please check in advance whether a visa is required for you at the homepage of the Federal Foreign Office
The visa application process can take several months. It is therefore recommended making an appointment at the German embassy or consulate closest to you as early as possible. Please find further details at the homepage of the German diplomatic mission
You need to apply for a visa for study/education, which is a D visa (national visa). The study visa is usually valid for 90 days and can then be converted into a long-term residence permit once you have arrived in Germany.
Do not apply for a Schengen visa (C visa), as this is only valid for a maximum stay of 90 days and cannot be extended or converted into a long-term residence permit.
More information on Visa regulations please find here