Firstly its really good that you have someone like your teacher who is cares about you enough to tell you something like that.
As for what to do, i should probably advocate professional help. But what helps me the most:
1.Figure out the triggers.
Like you say you had family problems was it because of lack of control, bereavement, abuse ect, im guessing that will be your primary trigger. Then as the your eating habits got worse, you started thinking about weight, appearance ect (anorexia can come with this thing called body dimorphic disorder -google it) thats your secondary trigger. So what i do whenever i feel triggered to stop eating is to try and address those issues(positive) rather than starving myself(negative).
2. Think about your future if you carry on.
You say you want to do well in your GCSE's, i assume its because you want to be/do something in your future, if you want to reach it you are going to have be healthy enough to last that long, if you get me.
3.Know risks of having an eating disorder.
I read once that for anorexia, 10% of suffers die from the disease(heart failure, osteoporosis, suicide, ect.), 20% recover, 80% will always be affected by it. This is my drive to be in the 20%.
thats my thought process when i feel like i want to go back to it, i hope i somewhat helped x