Praise be to Allah, and peace and blessings be upon the Messenger of Allah. To proceed:
Illness and trials do not indicate that Allah is angry with a person or does not love them. The prophets and righteous people were afflicted with some of the most severe forms of hardship, and a person does not know the wisdom and benefits that may lie behind Allah's decrees.
Therefore, a Muslim should praise Allah for the blessings that remain, look at those who are suffering greater hardships, think well of their Lord, and be patient while seeking His reward. Such trials may be a means of earning reward, having one's rank raised, and having sins expiated. The Prophet ﷺ said: “On the Day of Resurrection, the people who enjoyed well-being will wish, when those who were afflicted are given their reward, that their skins had been cut with scissors in this world.”
As for suicide, it is not a solution to hardship; rather, it is a grave sin, and it is never permissible to undertake it. The fact that Allah saved her from her suicide attempts is an opportunity for her to repent and return to Him. She should seek Allah's help, increase her supplication and seeking forgiveness, and not surrender to the whispers of Satan.
She does not necessarily have to leave her studies because of the illness. Rather, she should continue her life and pursue whatever means of treatment she can. She may also move to another educational environment if that would be more beneficial for her.
Among the beneficial supplications is: “O Allah, by Your knowledge of the unseen and Your power over creation, keep me alive as long as You know that life is better for me, and cause me to die when You know that death is better for me.”
If thoughts of suicide return or she feels that she may harm herself, she must not remain alone. She should immediately tell her family or a trusted person and seek help from a mental-health and medical professional. Seeking treatment and asking people for assistance are part of taking the lawful and appropriate means.
In conclusion: Illness is not evidence that Allah hates her or is punishing her. Rather, it is a trial that may contain goodness and reward. She should be patient, think well of Allah, seek treatment, continue with her life, and stay completely away from suicide.
And Allah knows best.