How do I tell thesis advisor I want to withdraw from research? (mental health) Context: Back in May I had asked a prominent professor whom I really admire for research opportunity. He gave me some study material to do over the summer and said he'd decide in the Fall. So in August, he "accepts me", but he also decided to let me work together with another undergraduate (who asked in August) on this project. This was two weeks ago. Today the other undergrad and I met with the Professor to discuss things. Working in a "group" basically ruined it for me. It's childish of me I know.

For these two weeks, I've been an absolute wreck. I've been so stressed about working with this other student. I've met with her, talked with her, and it is certainly possible for us to get along but I am just so so stressed and anxious. I feel competition exists now and it's simply a lot of pressure. I "dealt" with depression, (social) anxiety, self harm, and an eating disorder for 7-8 years now, and these past two weeks my eating disorder has gone completely out of control, since I use it for coping, I'm sleeping 5 hours max and I feel like I'm going out of my mind.

I've decided I really can't stay like this and want to withdraw from doing research with this Professor. I considered asking for an independent undergraduate level project but he did say he does not usually take undergraduate students and since beggars can't be choosers, I'm really afraid to ask. I have another professor in mind I can ask for research for my thesis (whom I'm more familiar with).

Sorry, I don't have anyone in real life I can talk to about this so I'm writing a lot on here. My point is, how can I tell this Professor I want to withdraw because of this social-anxiety-induced stress that I cannot handle? I don't want him to think I'm slacking/lazy/not interested because I am but I can't stay here (but maybe I shouldn't care about this). Is it "proper"/ok to give him the true reasons (group work) (better worded of course)? I dislike lying.

Thanks
First, I hope you are working with a mental health expert; I always hate to see people lose good opportunities due to issues like this. As Buffy says, you should definitely see if there is anyway you can make this work (though, a clean break is better than performing so poorly he has to fire you. A mental health expert can help you weigh these decisions).
At any rate, to your actual question:

how can I tell this Professor I want to withdraw?

Clearly and concisely. In person if possible, but if you cannot face that, an e-mail will do the trick:

Dear Professor,
Unfortunately, I am going to have to withdraw from research. I really enjoy working with you, the research has been very interesting, but due to some mental health issues, working in a group is not really feasible for me. It's nothing against [the other student], and I understand that research is often done in groups, but I'm not currently at a place where I can support group work. I am sorry to have to withdraw; thank you again for your efforts.
Name