In general, you are allowed to earn money with a side job while studying and there are many opportunities to do so. However, keep some legal regulations and your own study management in mind.
Where can I work?
Besides the typical student jobs, like waiting tables, baby-sitting and working in a supermarket or in a delivery service, you can also look for jobs that are related to your studies. The most prominent option is to work at your university as a student assistant.
Student assistants - so-called Hiwis in German (short form of Hilfswissenschaftler*in) - might supervise the library, give tutorials, support the research of their professors and so on.
Furthermore, you can work as a student employee (Werkstudent) for a company or an organisation that is active in the field of your interest. These jobs provide the advantage to gain practical experience and progress in your field of studies while working.
No matter what kind of work you choose, your studies should come first. Be aware that some jobs can be very exhausting and may harm your ability to focus on your studies, like physically demanding jobs or jobs with night shifts. Keep in mind that the job should only be a co-financing measure for your study and life costs, and that a great part of these may be covered by BaföG or scholarships.
If you want to find a job, but do not know where to search, find some tips here.
How can I continue my previous job after starting my studies?
You should talk to your employer about options to continue working while studying and keep in mind the working regulations for students. Let your employer know that you plan to study. This may also be in his or her interest as you will do better work with better qualifications. A lot of employers know about the regulations that they have to keep in mind for student employees and may offer you to reduce your working hours to your needs or to change to a position in the company where your new qualifications will be needed.