It’s going to be a painful week. Start on a Friday.
First, as everyone suggests, find out the “why” - scared? Lonely? Address these if you can. I let the family cats sleep with my children. My sister started putting her small dog on her youngest child’s bed when this came up. I also recommend a " white noise" machine. My son listens to “rain”. My daughter listens to “ocean”. Turn it on a bed time and leave it on all night.
Second, establish a routine. Do the same things every night, in the same order, to get to bedtime. Brush teeth, put on jammies, hop into bed, read a story, sing a goodnight song (or say prayers or??). Then lights out. Both my kids have night lights. My son has the door open, my daughter has the door shut. I kiss them goodnight, using exactly the words every night, and I leave.
The first week you may want to start with sitting next to the bed for 10 minutes, then 7, then 5, etc. just wean it down. Tell her when you are leaving. Do not steal off. She will come to find you.
If she gets out of bed, put her back into bed. I used to sing the song again, then the kiss and the phrase. Then leave.
You must keep taking her back to bed. Do not stay more than a few minutes or that will be the next, new normal. Back to bed. Repeat the end of the goodnight routine. Hug, kiss, tuck in. Off you go.
The first few days will be hard, but she will adjust. The routine helps immensely.
If she is nervous, I found it worked wonders to simply tell my son, “you are safe here. I (we) are in the house. Nothing will hurt you. This is a safe place. You are safe.” This is not the time for coming clean about house fires or home invasion. Just tell her she’s safe.
If you don’t have a pet you can leave with her, I also found a stuffed animal that had a heartbeat (or purr), when it was hugged or leaned on.
Good luck… Stand firm.