An internship during the course of your studies is usually a very good decision. You gain experience, collect methodical knowledge for your studies and usually get a valuable internship certificate in which your own achievements are explicitly mentioned.
Because many foreign companies in Germany have subsidiaries or their respective management holding companies, many internships are available to foreign students.
But also many German companies offer a wide variety of jobs for interns. The trainees have to be trained! The branches of German companies abroad are often staffed by foreign employees. Thus there is an explicit gap to be filled! This is precisely why it is important for German companies to offer internships for foreign students.
Students from the EU countries do not require a visa, but students from other countries often require one. If you are not from the EU area and need a visa, you can find more details here.
With confirmation of the company