The easy way is simply if you have enough financial means at your disposal or can rely on your family’s assistance - but not everyone is that lucky.
To earn one’s keep while studying is not only pretty hard but also limited for registered students in terms of time (there is a maximum number of hours allowed per week) and wages (only a certain amount is allowed). It is indispensable to inform yourself about the currently valid regulations, for instance here (in German)
For students coming from outside the European Union, the regulations are even more rigorous: a maximum of 120 days full-time work is allowed (compulsory internships not included). More...
Nevertheless, some possibilities of financial aid do exist. Some of them are only available in situ, that is during the studies: