She needs to trust that you will stay in order for her to feel safe, so this needs you you always stay until she is completely asleep. But that goes to mean you can't make progress towards independant sleep. Just make the steps very gradual.
If your start point is sitting on the floor next to her bed until she is asleep, your first step might be sitting next to the bed but facing side-on to her, not face on. Still stay until asleep.
Then sit an arms-reach away from the bed. If she's distressed, go close did cuddle to settle. Once calm, retreat your arms length away and still sat by the bed. Always stay until asleep, she needs to trust you won't sneak away without her knowing.
Once she's ok with you being an arms reach away (which might be a week or two), move from the floor to sit on a chair. Still stay until asleep, go closer if did needs you but retreat when calm.
After a few weeks, move the chair further away again. Give it a few more days/weeks. Then chair by the door, still staying until asleep.
Then start standing by the door, not sitting. Give that several days. Once she's alright with you standing by the door, start on the "I'm just popping to the toilet, I'll only be a minute" kind if thing. Put things away, tidy up. Basically develop reasons and excuses to leave the door for a minute or two. But always, always go back. Make the little jobs you have to do more frequent, always saying you'll check back.