Littledinoco has it spot on. My DD went through similar when she was 2-3yr old, refusing to eat and was underweight. My HV referred us onto a programme to support my DH and my behaviour and all the things mentioned in the pp above were what we were taught. It was called Henry, if you look it up at first I thought it was for overweight or unhealthy families but it can be adapted all round. I was so embarrassed at first to seek help and was convinced there were sensory/additional issues but it turned out to be almost all behavioural for us (not saying that is the case for yours but we were at the end of our tether and convinced we had tried it all)
Self serve - Put food in the middle of the table in bowls for her to help herself and not mentioning it at all, nothing positive or negative then after a period of time just removing it with 'tea is finished now'
Make them sit at the table with you, but with no pressure to eat. We had to use the 'reflection step' and make her repeatedly return the the table until everyone in the family finished our meal even if she ate nothing herself.
Introduce two small snacks and supper using the same method but try to keep carbs for main meal times e.g. fruit or yoghurt. We had reduced snacks and milk to try and make her hungry for meals but we were told her stomach would have adjusted to small amounts so little and often was best
No alternatives, if she doesn't like what you're eating just explain that's what you're having
No shouting, no begging, bargaining, just try a bit, you won't get pudding if you don't eat, mmmm this is tasty mummy loves it, you'll be hungry later if you don't eat now, etc. Ignore any comments about yuck, I don't like it, I'm not hungry, etc never respond, keep calm, Talk about anything except food (it's really hard!)
Get nursery on board, no more special attention, no taking her out early to give her tea, no alternatives for her (mine kept giving sandwiches when she didn't eat the meal and we had to put it in writing that we didn't want them to do this because their policy was never to leave a child hungry which while understandable undermined our work)
Increase activity/exercise. Our DD was lethargic and lacking in energy due to not eating so had started driving more rather than walking, didn't get out as much etc but the more exercise we did the more she ate so it was self fulfilling
Sign up family, my parents are old fashioned so hated waste, would hang over my DD encouraging her to eat, moving food around on her plate and it really stressed her out. Had to remind them before every visit, not talk about food or eating during our FaceTime calls etc
Get her involved with preparing food/baking/setting table even if she doesn't want to eat it herself.
It took about 6 months to get on an even keel but what a difference, our DD is a healthy weight, eats a lot more variety of foods and honestly we're all so much happier. Having her little brother eating with us at the table once he was weaned has also helped as he's a slow eater so she often returns to food on her plate (because we now make her sit until everyone has finished) and also competitive eating with her brother!
Good luck, it's hard work and we still have to return to some of the principles when things slip but it's so nice not to have that stress