If you come from an EU or EEA country or Switzerland, you can work in Germany without restriction and do not need a residence permit. Nationals of Australia, Israel, Japan, Canada, the Republic of Korea, New Zealand, the United Kingdom of Great Britain and Northern Ireland and the USA can enter Germany without a visa, but must apply for a suitable residence permit from the relevant foreigners authority in Germany before taking up employment.
All other nationals also require a corresponding residence permit in order to live and work in Germany. Before entering Germany, you must apply for the appropriate visa (long-term stay – D visa) at the German mission in your country of residence. Upon arrival in Germany, you must apply for a corresponding residence permit at the competent foreigners authority.
Further information can be found in the “How do I apply for a visa?” section.