Back when I studied math in the later Pleistocene (so, starting in 1996), the key reason for people quitting was that they had wrong expectations: they expected German university math to be like Gymnasium math, maybe a little harder. Many of them had never seen a proof. Then our professor spent the first ten minutes on field axioms. This was a major culture shock.
Quite a number of people left after the first lecture and never came back. I think this may have been a smart move.
Other people stuck it out for a few semesters and left later. Often, these were Lehramtsstudenten, i.e., people studying to become Gymnasium teachers, many of whom took one subject they liked (e.g., sports) and one subject that would get them a job (e.g., math). Yes, many of those were successful. But many lost a number of semesters before they called it quits on math.
Therefore, my suggestion would first of all be to understand what you are getting into. Find almost any book called "Analysis I" or similar and start reading from the beginning. You will not understand a single word at first. Re-read the first section a couple of times. You will see, after a while, that things actually make a kind of sense. There are typically no prerequisites. Everything is right there. The key stumbling block is that studying math requires a way of thinking you never have been exposed to in school. (Except possibly if you did math competitions.)
This is the kind of thing you will be doing for three years, or more. Imagine yourself doing this, over and over again. You will be sitting in class, keeping track of someone explaining this to you. Again, you will typically not understand much during the lecture. So you go home (or, better, meet with others in the same boat), go over everything and try to understand. Then you will do homework, each single piece of which is like a math competition, and you get at least two of these each and every week.
I usually describe studying math as brainwashing. Math professors don't like this description. But I believe it captures the important idea.
Now, after you have slogged through the first chapter of your "Analysis I" book, think about whether the prospect of doing this for years on end resonates with you. If yes, and if you maybe even find this fascinating, congratulations, you are now better prepared than probably 50% or 80% of incoming math students.
If you now still want to study math, then I would suggest you go get a few books on how to write proofs, and how to think mathematically. If you can already access your university library, there will likely be a lot there. You may even be able to download ebooks. Springer has a number of series of undergraduate math textbooks (e.g., Springer Studium Mathematik - Bachelor or Grundstudium Mathematik or the Springer Undergraduate Mathematics Series or the Undergraduate Texts in Mathematics), some of which are in exactly this vein. For instance, judging from the titles, you could look at Mathematisches Problemlösen und Beweisen or Exploring Mathematics by the same author, or perhaps Mathematical Writing.
In addition, sometimes universities offer refresher courses in math before the first semester starts. These can be helpful, too. Just be careful: if these are refresher courses for Gymnasium math which are mainly aimed at students in other disciplines that may use math in "the Gymnasium way", then this will likely not be very helpful to you.
Finally, the Fachschaft (which is kind of the students' self-organization) can be helpful. They all were first semester students once and likely still remember, and can offer lots of hints. (But note that there is a selection effect: these are the ones that are still around. The ones that quit math are elsewhere.) They might organize information sessions at the start of the semester.
And actually, from my understanding this applies to most European math programs. I believe that matters are quite a bit different in the US, with far less emphasis on "proof mathematics" in early semesters.