If you are a fee-paying student, the university may support you by reducing your tuition fee. You will need to apply for a reduction—more information on how to do that is available from the university’s student council.
Just ask the doctor or their assistant for an official justification of absence, hand it over to the relevant person at the uni, and that’s it. Rules vary according to universities and courses, obviously, but it is worth profiting from this possibility if you have a mandatory attendance requirement.
Sometimes, especially in case you are involved in an accident, become ill, or find yourself in unexpected circumstances, you can request the university to deactivate your student status. The period of passive status cannot exceed two semesters, but you can request it more than once, depending on the given university’s academic study and examination regulations. You can inform the university upfront about the possibility that you may need to avail yourself of this possibility, however, you will need to obtain a specific authorization in each case.