Your feelings are absolutely normal... if the relationship were ending and it had nothing to do with his coming out, you'd still be crushed and hurt and scared. Having loved and lost my HS sweetheart, whom I dated 7+ years, but never married or had children with, I understand at least on some level the feeling of "what now?!"... and "am i going to find another love??"... and "this isnt what we planned"
Pretty overwhelming stuff. Add to that the fact you took vows, had a child, stepped up and did your part... its just completely another level of trust and security that's been shattered.
His leaving you isn't him rejecting you sexually as a person or as an individual, even though it seems that way. It could have been any other woman... hed still be in this place.
I've not been where you are exactly. But I've lost big loves. Eventually I found my wife, a single mother who had a pre-teen daughter. Deep breath in and out girl... the anxiety about being rejected is just noise. This isn't what you want. It isn't what you'd choose. But you can work your way through this, though I wish you didn't have to.
Something to consider... I've always been one who thinks I can solve all problems myself, shoulder the struggle alone. I love to help others but hate asking for help. Just how I'm wired.
Having fought through a about of depression at one point, I can tell you talking to a counselor can honestly help. I HATED making the appointment. Making the call and writing down the date and time seemed to make my problem more "real"... it was there, on paper. Hated waiting in the office. Just didn't like any of it at all... but I walked out better. And I went back and each time felt better.
Mostly because I was able to talk things out with someone who wasn't a friend or family... someone who wasn't biased toward or against me. It's a good process, and some people can get a few sessions free through their workplace if its in your benefits... just something to think about. Talking to a counselor is just about getting you tools and organization to get things back on track. Just because you can do it alone doesn't mean you need to.
The following link talks about children and sexual awareness... I don't agree with it necessarily lock in step... I think you can talk to a child about divorce and sexuality in very simple terms. You don't have to be graffic. You can let the child guide the questions... process the answers.
As the father of a 4 year old, were I in your place, id focus on the separation issue first... that her father will be living in a different home, that he still loves her, etc. that the problem with mommy and daddy isn't due to her, that even if you two aren't together you will always be her parents, and simply tell her the next steps... daddy will be packing up his things, he will be moving to a new place, etc. be ready to have to repeat things, explain things again... it'll take time for her to understand what's happening. Stay close to her and spend time on her. Don't forget about yourself. Take time alone for yourself too.
All that said, here's a link about talking to your children about sex. Simple answers and letting the child ask questions is good.
Planned Parenthood How to Talk with Your Child About Sex
Sorry you are in this place. You'll get through it and you'll be OK. Its just going to be one hell of an emotional roller coaster for a time.
Feel free to talk things out here on the boards.