I'm an international student doing a PhD in California (UCR) for the past 4 years. This period of time has been nothing but nightmares. At least I got my masters last year, but immediately after I took a leave of absence which has lasted 10 months so far, and I don't want to go back to the same depressed and sickly state I was in. Let me explain: my department doesn't have a lot of funding for us, so I was always stressed about money and in debt, and selling my clothes to pay bills. 70% of my income went to rent. Obviously I had no money or energy to pursue other activities that could counteract the stress and depression (a good therapist, taking a fun class, going out, etc). I live in Riverside, which apart from the university, doesn't have anything to offer. I was extremely lonely, bored, drinking too much and suicidal. And I got sick from all that, to the point I had to get a small surgery. Obviously I couldn't focus on my actual studies in that state. I talked to my advisors about it, and at first they just said "oh no poor thing. Wish I could help. Just power through it." So I started talking about quitting. I hit rock bottom and just left the country and went back home to heal. Then, they started offering me small grants so I'd come back, and I said I would. In that time, I went to Germany to do a language course that my program will reimburse me for, and even met with my advisor in Berlin for an excursion (another excuse to get some funds for the trip). All that was great and I enjoyed it. They also offered me another grant for Fall quarter, so I wouldn't be so stressed about money. But I still have 2 more years to go. They have told me they really like my research and that I have so much potential, that I'm one of the best of the program, etc, to let me know they don't want me to leave. However, I don't have a clear idea of where my project is going. And I feel like my main advisor is not happy with some of my interests: he made a rude comment to me about liking feminism (he treated me like a child who doesn't know better). So, hating the place I live, afraid of going back there and not being able to turn the situation around, and having philosophical conflicts with advisors, I don't think it's worth it. But, how can I quit without angering them? And, even though I don't know if I'll apply to a different program any time soon...Can I ask for a letter of recommendation for the future?
The situation you describe is serious, but you have plenty of way out.
First: do not let the sunken cost fallacy harm you. You spent 4 years in this program, but "Just power through it" is the usual bullshit from privileged people when they think they faced similar challenges in their past. This goes well with the paternalistic attitude your advisor showed you afterwards. It is not worthwhile to spend 2 years of your life in this crappy conditions. Said otherwise: if you manage to spend 2 years of your life in this conditions and you are "succesful", it means that you can spend 2 years of your life in ANY other way and being equally (if not more) succesful (define succesful any way you like) and HAPPIER.
So send your best regards to the advisor, propose them to further pursue your PhD fully remotely, if they say yes and you have a pinch for masochistic things go ahead, if they say no just thank them for their past support. checking if you can ask them a reference letter in the future is of no harm.
Best of luck, you already proved that you can endure enormous stress, unhappiness and insatisfaction, no need to further the pain, a PhD title is just three letters after/before (Dr.) a name, they are meaningless if the person carrying that name have been obliterated (or become a dull paternalistic person telling others to "power through difficulties" ... after years of you already doing that).