If you fail in many courses, you should take the initiative to communicate with the department counselors and department leaders.
Ask them what is the bottom line of failing in the exam, and how to make up for it if they fail in the exam. In fact, the relationship in the university is relatively simple and does not require too many gifts. The suggestion is to ask directly in their office, and they will be eager to answer your questions.