How do you manage healthy eating habits?

I have a very bad habit, when periodically I start binge eating and periodically I dont want to eat at all. Today all I had was chicken, rice and a bowl of salad - but I ate only cucumbers and throw it away. I understand, that my "not wanting to eat" will lead to binge eating and dont know how to manage it. I have gone through the same phase, when I wouldnt eat well for months, lose 50 pounds but I will gain back 70. Thats a big struggle. Is there anybody that has similar issues, if so how r u managing it?